-
Notifications
You must be signed in to change notification settings - Fork 25
Metrics Ideas
Tom Hombergs edited this page Oct 26, 2016
·
1 revision
This page gives an overview of ideas which metrics might one day be supported by coderadar analyzer plugins.
Metric name | Description | Aggregation | Analyzer |
---|---|---|---|
coderadar:size:elocPerMethod:java | Effective Lines of Code per Method | AVG | to be done |
coderadar:size:elocPerClass:java | Effective Lines of Code per Method | AVG | to be done |
coderadar:size:methodsPerClass:java | Number of methods per class | AVG | to be done |
File Metrics are metrics that describe a single source code file. These metrics can be aggregated over several files or the whole codebase.
Metric name | Description | Comment | Input |
---|---|---|---|
Percentage of Comments | Percentage of comments relative to all code lines | ||
Checkstyle Violations | One metric for each checkstyle violation (Java). | Source Code File | |
Findbugs Violations | One metric for each Findbugs violation | Findbugs operates on bytecode not on source files! | Bytecode File |
No. of changes | Total number of changes of a file | Source Code File | |
Nested Blocks 4+/5+/6+ ... | Number of Blocks at given nested level or above | Source Code File | |
No. of Committers | Number of people who touched a file | Only valid between two commits! | No. of Committers in Start Commit, No. of Committers in End Commit |
Cyclomatic complexity | Source Code File? | ||
No. of ToDos | No. of TODO-Comments in a file | Must be configurable as to which todo-patterns should be counted | Source Code File |
WTF-Count | No. of bad words in a file | Must be configurable as to which bad words should be counted | Source Code File |
Undocumented API | Public members that are not documented with Javadoc | Source Code File | |
JSHint Violations | One metric for each JSHint violation (Javascript) | Source Code File | |
Javascript Test Coverage | Percentage of Lines / Files that are covered by unit tests | Coverage Result from Istanbul? | |
Java Test Coverage (Lines / Methods / Classes) | Percentage of Lines / Methods / Classes that are covered by unit tests | Coverage Result from build process (Cobertura?) | |
Depth of Inheritance Tree | Depth of ancestor hierarchy | Can only be calculated within a whole set of classes | All Source Code Files |
Number of Children | Number of child classes | Can only be calculated within a whole set of classes | All Source Code Files |
Afferent Couplings | Number of classes that depend upon this class | Must be calculated specifically for packages, cannot be aggregated | All Source Code Files |
Efferent Couplings | Number of classes this class depends on | Must be calculated specifically for packages, cannot be aggregated | All Source Code Files |
Unused Code | Number of Lines of Code that are not used by other code | All Source Code Files |
Derived Metrics are metrics that are calculated out of other metrics.
Metric name | Description | Comment |
---|---|---|
No. of changes per day/week/month | Average No. of changes of a file per day/week/month | Can only be calculated between two commits: (No. of changes at commit 2 - No. of changes at commit 1) / time unit# |
No. of changes in commit range | Number of changes of a file between two commits | Can only be calculated between two commits: (No. of changes at commit 2 - No. of changes at commit 1) |
Days/Weeks/Months with changes | Number of Days/Weeks/Months in which at least one change was made to a file | |
Weighted Nested Blocks | Combines Nested Blocks 4+/5+/6+ ... each with a weight (4, 5, 6, ...) to make a single complexity metric | |
No. of committers | The number of committers that touched a file in a certain time range |
Fileset Metrics are metrics that are calculated over a whole set of files
Metric name | Description | Comment |
---|---|---|
Code Duplication | Percentage of duplicate code | must be further specified! |
Abstractness | Ratio of number of abstract classes and interfaces to the total number of classes |