Coder Social home page Coder Social logo

filesmetrics's Introduction

FileMetrics

Introduction

This project aims at providing a library for computing common metrics of a C file from Java program. The analysis is based on the result provided by the joern tool. To allow a better handling of dependency the tool has been ported organized for maven and only the parts relevant to this project were kept. This version can be found in the joern repository

Use

The library is written in Kotlin but can be used from Java. The library take the File content (String) as an input.

val cm = CodeMetrics(fileContent)
cm.cyclomaticComplexity()

Different functions can then be called to retrieved the different Metrics

Computed Metrics

List of Code Metrics:

  • Blank Line
  • LOC
  • preprocessor Lines
  • Lines of comments
  • Comment/LOC ratio
  • Number of Function
  • Number of Variable declaration
  • Cyclomatic Complexity of all Function
  • Essential Complexity of all Function
  • FANIN
  • FANOUT
  • Graph Edit Distance

Other uses

This library uses the following function to compute the metrics that can be reuse in other context:

  • Function level

    • list of Parameters (distinction possible between reference and value)
    • list of calls
    • list of assignment
    • list of declaration
    • all complexity metrics + nesting + fan in / fan out
  • File Level

    • list of function names
    • list of Global variable
    • map of call made by a function

filesmetrics's People

Contributors

electricalwind avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.