Code Metrics



Source Code Metrics

Knowing what is inside your source code is the first step in assessing the quality of the software product. Knowing the quantity of work performed in generating the source code is the first step in determining the productivity of your software team. Resource Standard Metrics measures the quantity and quality of your source code by measuring the language attributes and lines of code, LOC. RSM reports are available in text, html and csv formats. Some of the metrics RSM calculates are explained at the following link (Metrics Narration).

Source Code Metrics

Function Metrics

Per Function

  • LOC Lines of Code
  • eLOC (Effective LOC)
  • lLOC (Logical Statements LOC)
  • FP Function Points Derived from LOC metrics
  • Comments Lines
  • Blank Lines
  • Physical Lines
  • Number of Input Parameters
  • Number of Return Points
  • Interface Complexity (Parameters + Returns)
  • Cyclomatic Complexity Logical Branching
  • Functional Complexity (Interface + Cyclomatic)
  • Functional Quality Analysis RSM Quality Analysis

All Functions

  • Number of functions Total, Average, Maximum and Minimums
  • LOC, eLOC, lLOC
  • FP Function Points Derived from LOC metrics
  • Comment and Blank lines
  • Logical and Physical Lines
  • Return Points
  • Function Parameters
  • Cyclomatic Complexity
  • Functional Complexity
  • Total Quality Profile Example

Class Metrics

Per Class

  • Number of public, private, protected data attributes
  • Number of public, private, protected methods
  • Template Type
  • Inheritance
  • Depth of Inheritance Tree Example
  • Number of derived child classes per base class
  • LOC Lines of Code
  • eLOC (Effective LOC)
  • lLOC (Logical Statements LOC)
  • Comments Lines
  • Blank Lines
  • Physical Lines
  • Number of Input Parameters
  • Number of Return Points
  • Interface Complexity (Parameters + Returns)
  • Cyclomatic Complexity Logical Branching
  • Class Complexity (Interface + Cyclomatic)
  • Class Quality Analysis RSM Quality Analysis

All Classes

  • Total number of classes
  • Inheritance Tree
  • Number of Base Classes
  • Number of Derived Classes
  • Derived/Base Class Ratio
  • Maximum and Average Inheritance Depth
  • Maximum and Average Number of Child Classes
  • public, private, protected data attributes
  • public, private, protected methods
  • LOC Lines of Code
  • eLOC (Effective LOC)
  • lLOC (Logical Statements LOC)
  • Comments Lines
  • Blank Lines
  • Physical Lines
  • Number of Input Parameters
  • Number of Return Points
  • Interface Complexity (Parameters + Returns)
  • Cyclomatic Complexity Logical Branching
  • Class Complexity (Interface + Cyclomatic)
  • Total Quality Profile Example

Namespace or Package Metrics

Per Namespace

  • Number of classes
  • Number of functions
  • Average functions per class
  • Number of public, private, protected data attributes
  • Number of public, private, protected methods
  • LOC Lines of Code
  • eLOC (Effective LOC)
  • lLOC (Logical Statements LOC)
  • Comments Lines
  • Blank Lines
  • Physical Lines
  • Number of Input Parameters
  • Number of Return Points
  • Interface Complexity (Parameters + Returns)
  • Cyclomatic Complexity Logical Branching
  • Package/Namespace Complexity (Interface + Cyclomatic)
  • Quality Analysis RSM Quality Analysis

All Namespace/Packages

  • Total number of classes
  • Total number functions
  • public, private, protected data attributes
  • public, private, protected methods
  • LOC Lines of Code
  • eLOC (Effective LOC)
  • lLOC (Logical Statements LOC)
  • Comments Lines
  • Blank Lines
  • Physical Lines
  • Number of Input Parameters
  • Number of Return Points
  • Interface Complexity (Parameters + Returns)
  • Cyclomatic Complexity Logical Branching
  • Namespace/Package Complexity (Interface + Cyclomatic)
  • Total Quality Profile Example

File Metrics

  • LOC Lines of Code Example
  • eLOC (Effective LOC) Example
  • lLOC (Logical Statements LOC) Example
  • FP Function Points Derived from LOC metrics
  • Comments Lines Example
  • Blank Lines Example
  • Logical and Physical Lines Example
  • Comment and White space percentages Example
  • Average Character line length Example
  • Memory Allocation and De-allocation metrics Example
  • Language Keyword use Example
  • Language Construct use Example
  • Extract Comments per file for understandability rating and spell checking Example
  • Extract Strings per file for spell checking Example
  • Create files in line numbered format for code reviews Example
  • Number of Quality Notices per file Example
  • Metrics differentials between two file version Example

Project Metrics

  • Total LOC, eLOC, lLOC, Comment, Blanks, Lines Example
  • FP Function Points Derived from LOC metrics Example
  • Total Function Metrics Example
  • Total Class Metrics Example
  • Total Namespace Metrics Example
  • Inheritance Tree and Metrics Example
  • Language Keywords, constructs and metrics Example
  • Quality Profile Example
  • Metric Estimation Factors for software estimates Example
  • Total Language Metrics Example Example
  • Total C, C++ and Header Files Example
  • Total Java Files Example
  • Total Number of Files Example