Skip to content

Tool to calculate code metrics based on the XML representation of the source code obtained by applying @srcML

Notifications You must be signed in to change notification settings

mzagane/ZM_J_Code_Metrics

Repository files navigation

ZM_J_Code_Metrics

The java version of @ZM_Source_Code_Metrics, in this version, we use an intermediate XML representation of the source code obtained by applying @srcML, this helps parsing code and improving the speed of code processing.

1) Metrics that can be calculated in the cuurent version (1.06.06.2020)

1.1) LOC :

  • Total number of lines (physic lines),
  • lines of comments,
  • Blank lines

1.2) McCab Metrics :

  • McCab Number (cyclomatic complexity)

1.3) Halstead complexity metrics :

  • n1: Number of distinct operators
  • n2: Number of distinct operands
  • N1: Total number of operators
  • N2: Total number of operands
  • n: Program vocabulary
  • N: Program length
  • N': Calculated program length
  • V: Volume
  • D: Difficulty
  • E: Effort
  • T: Time Required To Program
  • B1 :Number of delivered bugs
  • B2 :Number of delivered bugs

2) Supported languages :

The metrics are calculated based on the XML representation generated by the srcML tool, therefore theoretically, all languages supported by srcML can be supported by ZM J Code Metrics. The current version works very fine with c/c++, a minors changes can be done to support the others languages supported by srcML.

Please note that, to calculate metrics, ZM Code Metrics needs some information about the language, such as the list of key words, control commands,... these information are stored in a config file (Languages_Settings.properties). When trying to add support for a language, this must be taken in account, ( may be this is the only major modification to be done)

3) Requirements:

The only requirement needed is srcML, to use this tool you have to install the srcML tool and update the file :App_Settings.properties, by adding the full path to srcML.

4) Funding request :

I am looking for funding, to improve the project by: adding support for other languages, adding other metrics, improving performance, etc.

Funding is for:

  • My own time (development and research),
  • Upgrading Github account, web hosting

About

Tool to calculate code metrics based on the XML representation of the source code obtained by applying @srcML

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages