com.bitblends.scalametrics.stats.model

Members list

Type members

Classlikes

case class BranchDensityStats(branches: Int, ifCount: Int, caseCount: Int, loopCount: Int, catchCaseCount: Int, boolOpsCount: Int, densityPer100: Double, boolOpsPer100: Double) extends Serializer

Represents statistics related to branch density within a codebase. This includes counts of various branching structures (e.g., if-statements, loops, case expressions) and boolean operations, along with their calculated densities per 100 lines of code.

Represents statistics related to branch density within a codebase. This includes counts of various branching structures (e.g., if-statements, loops, case expressions) and boolean operations, along with their calculated densities per 100 lines of code.

This class enables the analysis and combination of branch density statistics for different parts of a codebase.

Value parameters

boolOpsCount

The number of boolean operations (e.g., &&, ||).

boolOpsPer100

Precomputed density of boolean operations per 100 lines of code.

branches

The total number of branching structures (e.g., if-statements, case expressions).

caseCount

The number of case expressions.

catchCaseCount

The number of catch-case blocks.

densityPer100

Precomputed overall branch density per 100 lines of code.

ifCount

The number of if-statements.

loopCount

The number of loop structures.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class CoreStats(totalLoc: Int, totalFunctions: Int, totalPublicFunctions: Int, totalPrivateFunctions: Int, totalFileSizeBytes: Long, totalSymbols: Int, totalPublicSymbols: Int, totalPrivateSymbols: Int, totalNestedSymbols: Int, totalDocumentedPublicSymbols: Int, totalDeprecatedSymbols: Int, totalDefsValsVars: Int, totalPublicDefsValsVars: Int) extends Serializer

Represents core statistical metrics for analyzing codebases and their components.

Represents core statistical metrics for analyzing codebases and their components.

This case class provides various metrics, including lines of code, function counts, symbol statistics, and size information. It supports operations such as combining metrics with another CoreStats instance and can generate a formatted string representation for easier interpretation of the data.

Value parameters

totalDefsValsVars

The total number of definitions, vals, and vars in the codebase.

totalDeprecatedSymbols

The total number of deprecated symbols in the codebase.

totalDocumentedPublicSymbols

The total number of documented public symbols in the codebase.

totalFileSizeBytes

The total file size in bytes of the codebase.

totalFunctions

The total number of functions in the codebase.

totalLoc

The total number of lines of code.

totalNestedSymbols

The total number of nested symbols in the codebase.

totalPrivateFunctions

The total number of private functions in the codebase.

totalPrivateSymbols

The total number of private symbols in the codebase.

totalPublicDefsValsVars

The total number of public definitions, vals, and vars in the codebase.

totalPublicFunctions

The total number of public functions in the codebase.

totalPublicSymbols

The total number of public symbols in the codebase.

totalSymbols

The total number of symbols in the codebase.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class FileStats(metadata: FileStatsMetadata, rollup: Rollup, memberStats: Vector[MemberStats], methodStats: Vector[MethodStats]) extends Serializer

Represents the aggregated statistical data for a source file in a software project.

Represents the aggregated statistical data for a source file in a software project.

This class encapsulates the metadata, calculated metrics, and detailed statistics for the file, combining high-level rollup metrics and granular information for its members and methods. It is designed to provide a comprehensive view of a file's structure and characteristics in the context of the overall project.

Value parameters

memberStats

Statistical data for individual members within the file, providing information on their characteristics, such as size, visibility, and complexity.

metadata

Metadata and header information about the file, including its name, size, and associated package.

methodStats

Detailed statistics for methods defined in the file, including metrics on performance, complexity, and patterns used within the code.

rollup

Aggregated metrics summarizing various attributes of the file, such as lines of code, function statistics, symbol statistics, and pattern matching usage, among others.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class FileStatsMetadata(projectId: String, fileId: String, fileName: String, filePath: String, packageName: String, linesOfCode: Int, fileSizeBytes: Long) extends Serializer

Represents metadata and header information about a file within a project. This class captures essential attributes of a file, such as its identification, name, associated package, size, and the number of lines of code.

Represents metadata and header information about a file within a project. This class captures essential attributes of a file, such as its identification, name, associated package, size, and the number of lines of code.

Value parameters

fileId

Unique identifier for the file within the project.

fileName

Name of the file, including extension.

filePath

Relative path from project root to the file.

packageName

Fully qualified name of the package containing the file.

projectId

Unique identifier of the project to which the file belongs.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class InlineAndImplicitStats(explicitDefsValsVars: Int, explicitPublicDefsValsVars: Int, inlineMethods: Int, inlineVals: Int, inlineVars: Int, inlineParams: Int, implicitVals: Int, implicitVars: Int, implicitConversions: Int, givenInstances: Int, givenConversions: Int) extends Serializer

Represents statistical metrics related to explicitness, inlining, and implicit usage in a codebase. This case class extends StatsBase and provides detailed insights into the declared methods, variables, and functional usage within a Scala codebase, particularly addressing different Scala language features.

Represents statistical metrics related to explicitness, inlining, and implicit usage in a codebase. This case class extends StatsBase and provides detailed insights into the declared methods, variables, and functional usage within a Scala codebase, particularly addressing different Scala language features.

Value parameters

explicitDefsValsVars

The total number of explicitly defined defs, vals, and vars in the code.

explicitPublicDefsValsVars

The total number of explicitly defined public defs, vals, and vars.

givenConversions

The number of given conversions declared in the codebase (Scala 3).

givenInstances

The number of given instances declared in the codebase (Scala 3).

implicitConversions

The number of declared implicit conversions present in the codebase.

implicitVals

The number of vals defined with the implicit modifier.

implicitVars

The number of vars defined with the implicit modifier.

inlineMethods

The number of methods defined with the inline modifier.

inlineParams

The number of parameters defined with the inline modifier.

inlineVals

The number of vals defined with the inline modifier.

inlineVars

The number of vars defined with the inline modifier.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class MemberStats(metadata: Metadata, complexity: Int, nestingDepth: Int, hasScaladoc: Boolean, inlineAndImplicitStats: InlineAndImplicitStats, patternMatchingStats: PatternMatchingStats, branchDensityStats: BranchDensityStats) extends SymbolStatsBase, Serializer

Represents statistics and metrics associated with a member or symbol in a Scala codebase.

Represents statistics and metrics associated with a member or symbol in a Scala codebase.

This case class provides detailed insights into various attributes of a member, such as complexity, nesting depth, presence of Scaladoc, and a variety of specific metrics related to inline and implicit constructs, pattern matching, and branch density.

Value parameters

branchDensityStats

Metrics that provide insights into the branching intensity and density for the member, including counts of branches, loops, and conditional statements.

complexity

The cyclomatic complexity of the member, representing its logical complexity based on the control flow structure.

hasScaladoc

Indicates whether the member includes Scaladoc documentation.

inlineAndImplicitStats

A set of metrics related to the inline and implicit characteristics of the member, such as the presence of the inline modifier, implicit conversions, and abstractness.

metadata

Metadata describing the member, including its name, type, access modifier, location, and other properties.

nestingDepth

The maximum depth of nested constructs within the member, providing an indication of structural complexity.

patternMatchingStats

Metrics that assess the complexity and usage of pattern matching constructs within the member, including the number of cases, guards, and wildcards.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class MethodStats(metadata: Metadata, complexity: Int, hasScaladoc: Boolean, nestingDepth: Int, parameterStats: ParameterStats, inlineAndImplicitStats: InlineAndImplicitStats, patternMatchingStats: PatternMatchingStats, branchDensityStats: BranchDensityStats) extends SymbolStatsBase, Serializer

A case class that represents various statistics and metrics gathered for a method within a Scala codebase.

A case class that represents various statistics and metrics gathered for a method within a Scala codebase.

This class provides insights into a method's structural and complexity characteristics, including:

  • Metadata about the method's declaration.
  • Cyclomatic complexity of the method, which reflects the number of independent execution paths.
  • Documentation availability, indicating whether the method has associated Scaladoc.
  • Nesting depth within the method, representing the depth of block and control structure nesting.
  • Parameter-level metrics that detail the use and characteristics of method parameters.
  • Inline and implicit-related information, reflecting modifiers and inferred traits of the method.
  • Pattern matching-related metrics, capturing the usage and complexity of pattern match constructs.
  • Branch density metrics to assess control flow density complexity.

Value parameters

branchDensityStats

Metrics assessing branch density within the method, providing insight into the control flow and branching within its implementation.

complexity

Cyclomatic complexity of the method, representing the number of independent execution paths.

hasScaladoc

Indicates whether the method is documented with associated Scaladoc.

inlineAndImplicitStats

Inline and implicit-related metrics summarizing characteristics like inline modifiers, implicit conversions, and given instances or conversions (Scala 3).

metadata

Metadata associated with the method's declaration, providing contextual information such as identity, structure, access modifiers, and declaration properties.

nestingDepth

The maximum depth of nested blocks or control structures within the method.

parameterStats

Detailed statistics related to the method's parameters, such as total parameter count, number of implicit parameters, variadic parameters, and others.

patternMatchingStats

Pattern match-related metrics, capturing the structure, nesting, guard clauses, and wildcard usage within the method.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class PackageMetadata(projectId: String, name: String) extends Serializer

Represents metadata information for a package within a project.

Represents metadata information for a package within a project.

Value parameters

name

The name of the package.

projectId

The unique identifier of the project to which the package belongs.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class PackageStats(metadata: PackageMetadata, rollup: Rollup, fileStats: Vector[FileStats]) extends Serializer

Represents statistical data for a package, including aggregated package-level metrics and metrics for individual files within the package.

Represents statistical data for a package, including aggregated package-level metrics and metrics for individual files within the package.

Value parameters

fileStats

A collection of file-level statistics within the package, represented as a Vector of FileStats instances.

rollup

An aggregated summary of statistical metrics for the package, encapsulated in a PackageRollup instance.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ParameterStats(totalParams: Int, paramLists: Int, implicitParamLists: Int, usingParamLists: Int, implicitParams: Int, usingParams: Int, defaultedParams: Int, byNameParams: Int, varargParams: Int) extends Serializer

Represents a collection of metrics related to parameters and parameter lists in a codebase.

Represents a collection of metrics related to parameters and parameter lists in a codebase.

This case class provides an analysis of parameters in terms of quantity and special characteristics, aiding in understanding the structure and complexity of function or method definitions.

Value parameters

byNameParams

The total number of by-name parameters.

defaultedParams

The count of parameters that have default values defined.

implicitParamLists

The count of implicit parameter lists.

implicitParams

The total number of individual implicit parameters.

paramLists

The total number of parameter lists in a method or function.

totalParams

The total number of parameters across all parameter lists.

usingParamLists

The count of using parameter lists.

usingParams

The total number of parameters utilizing the using keyword.

varargParams

The total number of variadic parameters.

Attributes

Constructor

Creates an instance of ParameterMetrics.

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class PatternMatchingStats(matches: Int, cases: Int, guards: Int, wildcards: Int, maxNesting: Int, nestedMatches: Int, avgCasesPerMatch: Double) extends Serializer

Represents detailed statistics related to pattern matching constructs within a codebase.

Represents detailed statistics related to pattern matching constructs within a codebase.

Value parameters

avgCasesPerMatch

The average number of case statements per pattern match expression.

cases

The total number of case statements analyzed within pattern matching expressions.

guards

The total count of guard conditions used in the pattern matching cases.

matches

The total number of pattern matches encountered.

maxNesting

The maximum level of nesting within pattern matching constructs.

nestedMatches

The total count of nested pattern matching statements.

wildcards

The number of occurrences of wildcard patterns (e.g., _) used in pattern matching.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ProjectMetadata(name: String, version: String, scalaVersion: String, description: Option[String], crossScalaVersions: Seq[String], organization: Option[String], organizationName: Option[String], organizationHomepage: Option[String], homepage: Option[String], licenses: Option[String], startYear: Option[String], isSnapshot: Option[String], apiURL: Option[String], scmInfo: Option[String], developers: Seq[String], versionScheme: Option[String], projectInfoNameFormal: Option[String]) extends Serializer

Represents metadata and configuration details for a project.

Represents metadata and configuration details for a project.

Value parameters

apiURL

An optional URL to the project's API documentation.

crossScalaVersions

A sequence of Scala versions for cross-compilation.

description

An optional description or summary of the project.

developers

An optional string detailing information about the developers involved in the project.

homepage

An optional homepage URL for the project.

isSnapshot

An optional string indicating if the project version is a snapshot.

licenses

An optional license information for the project, typically in the form of SPDX identifier(s).

name

The name of the project.

organization

An optional identifier for the organization overseeing the project.

organizationHomepage

An optional homepage URL of the organization.

organizationName

An optional name of the organization overseeing the project.

projectInfoNameFormal

An optional, formal name for the project, if applicable.

scalaVersion

The Scala version used in the project.

scmInfo

An optional string containing source control management information.

startYear

An optional start year indicating when the project was initiated.

version

The version of the project.

versionScheme

An optional versioning scheme used by the project (e.g., "semantic").

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ProjectStats(metadata: ProjectMetadata, rollup: Rollup, packageStats: Vector[PackageStats]) extends Serializer

Represents a project with its associated metadata, rollup information, and a collection of packages.

Represents a project with its associated metadata, rollup information, and a collection of packages.

Value parameters

metadata

Contains metadata and descriptive information about the project such as name, version, Scala version, and other optional details.

packageStats

A collection of packages associated with the project.

rollup

Aggregated or summary information of packages.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Rollup(totalCount: Int, averageFileSizeBytes: Long, returnTypeExplicitness: Double, publicReturnTypeExplicitness: Double, itemsWithHighComplexity: Int, itemsWithLowDocumentation: Int, itemsWithHighNesting: Int, itemsWithHighBranchDensity: Int, itemsWithHighPatternMatching: Int, itemsWithHighParameterCount: Int, avgCyclomaticComplexity: Double, maxCyclomaticComplexity: Int, avgNestingDepth: Double, maxNestingDepth: Int, scalaDocCoveragePercentage: Double, deprecatedSymbolsDensityPercentage: Double, coreStats: CoreStats, inlineAndImplicitStats: InlineAndImplicitStats, patternMatchingStats: PatternMatchingStats, branchDensityStats: BranchDensityStats, parameterStats: ParameterStats) extends Serializer

Represents an aggregated summary of various statistical metrics for a software project, package, or file.

Represents an aggregated summary of various statistical metrics for a software project, package, or file.

This case class encapsulates a wide range of metrics, including counts, averages, and percentages related to code complexity, documentation coverage, and other relevant statistics. It also includes nested statistics for core metrics, inline and implicit usage, pattern matching, branch density, and parameter statistics.

Value parameters

averageFileSizeBytes

The average size of files in bytes.

avgCyclomaticComplexity

The average cyclomatic complexity across all items.

avgNestingDepth

The average nesting depth across all items.

branchDensityStats

Statistics related to branch density encapsulated in a BranchDensityStats instance.

coreStats

Core statistical metrics encapsulated in a CoreStats instance.

deprecatedSymbolsDensityPercentage

The density percentage of deprecated symbols.

inlineAndImplicitStats

Statistics related to inline and implicit usage encapsulated in an InlineAndImplicitStats instance.

itemsWithHighBranchDensity

The count of items with average branch density above a defined threshold.

itemsWithHighComplexity

The count of items with average complexity above a defined threshold.

itemsWithHighNesting

The count of items with average nesting depth above a defined threshold.

itemsWithHighParameterCount

The count of items with average parameter count above a defined threshold.

itemsWithHighPatternMatching

The count of items with average pattern matching statistics above a defined threshold.

itemsWithLowDocumentation

The count of items with documentation coverage below a defined threshold.

maxCyclomaticComplexity

The maximum cyclomatic complexity observed among all items.

maxNestingDepth

The maximum nesting depth observed among all items.

parameterStats

Statistics related to parameter usage encapsulated in a ParameterStats instance.

patternMatchingStats

Statistics related to pattern matching encapsulated in a PatternMatchingStats instance.

publicReturnTypeExplicitness

The percentage of public definitions with explicit return types.

returnTypeExplicitness

The percentage of definitions with explicit return types.

scalaDocCoveragePercentage

The overall ScalaDoc coverage percentage.

totalCount

The total number of items (e.g., files or packages) included in the rollup.

Attributes

Supertypes
trait Serializable
trait Serializer
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait Serializer extends Product

Provides serialization utilities for classes that extend this trait. Enables conversion of an instance into a map or its JSON string representation.

Provides serialization utilities for classes that extend this trait. Enables conversion of an instance into a map or its JSON string representation.

This trait must be mixed in with classes that extend Product, leveraging the product's fields for serialization.

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
object Serializer

Companion object for the StatsBase trait, providing utility functions to facilitate data transformation, serialization, and manipulation for statistical models. These utilities enable conversion of data structures such as maps and products into alternative representations like flattened maps or JSON strings.

Companion object for the StatsBase trait, providing utility functions to facilitate data transformation, serialization, and manipulation for statistical models. These utilities enable conversion of data structures such as maps and products into alternative representations like flattened maps or JSON strings.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Serializer.type

Represents the base properties and metrics of a member within a codebase.

Represents the base properties and metrics of a member within a codebase.

This trait defines several attributes that provide detailed information about a code member, including its name, signature, access modifier, metrics related to cyclomatic complexity, nesting depth, pattern matching, and branch density, as well as metadata about deprecated state and Scaladoc presence.

Metrics and properties:

  • General descriptors such as identifier, name, and signature.
  • Indicators of Scaladoc presence and deprecation status.
  • Cyclomatic complexity and nesting depth of the member.
  • Pattern matching details, including matches, cases, guards, wildcards, maximum nesting, nested matches, and average cases per match.
  • Branch density metrics, including branch counts and related boolean operations.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class MemberStats
class MethodStats