Skip to main content

Metrics

Metrics are grouped by category to help you understand their purpose.

  • ✅ - this metric is included into the metrics-recommended preset
  • ⚙️ - this metric has additional configuration options

Function / Method Metrics 9 metrics

cyclomatic-complexity

Measures the number of linearly independent paths through a block of code

⚙️🛠
halstead-volume

Measures how much information does the reader of the code have to absorb to understand its meaning

⚙️🛠
lines-of-code

Measures the total number of lines a function/method/constructor has (including its signature, parameters, all blank lines and comments)

⚙️🛠
maintainability-index

Measures how difficult a piece of code will be to maintain over time

⚙️🛠
maximum-nesting-level

Measures the maximum number of nested blocks that are present in a function/method

⚙️🛠
number-of-parameters

Measures the number of parameters a function/method has

⚙️🛠
number-of-used-widgets

Measures the total number of used widgets in every method that returns a widget (e.g. build)

⚙️🛠
source-lines-of-code

Measures the number of lines in the body of a function/method/constructor, excluding blank lines and comments

⚙️🛠
widgets-nesting-level

Measures the maximum number of nested widgets in every method that returns a widget (e.g. build)

⚙️🛠

Class Metrics 10 metrics

coupling-between-object-classes

Measures the number of distinct classes to which a given class/mixin/enum/extension type is coupled

⚙️🛠
depth-of-inheritance-tree

Measures the maximum inheritance path, referring to the number of levels a class is from the root class in an inheritance hierarchy

⚙️🛠
number-of-added-methods

Measures the total number of methods that a class defines on its own, separate from those it inherits from parent classes

⚙️🛠
number-of-implemented-interfaces

Measures the number of interfaces a class/enum/mixin implements (including direct and indirect interfaces)

⚙️🛠
number-of-methods

Measures the total number of declared methods in a class/extension/mixin/enum/extension type

⚙️🛠
number-of-overridden-methods

Measures the number of methods a class/mixin/enum overrides from its superclass or interface

⚙️🛠
response-for-class

Measures the number of uniquely invoked methods plus the number of methods in the class/mixin/enum/extension/extension type

⚙️🛠
tight-class-cohesion

Measures how well the methods of a class are related to each other by sharing access to at least one common instance field declared in that class

⚙️🛠
weight-of-class

Measures whether a class reveals more data than behavior

⚙️🛠
weighted-methods-per-class

Measures the sum of the cyclomatic complexity of all methods in a class/extension/mixin/enum/extension type

⚙️🛠

File Metrics 3 metrics

number-of-external-imports

Measures the number of dart: and all package: imports coming from pub dependencies

⚙️🛠
number-of-imports

Measures the total number of imports in a file

⚙️🛠
technical-debt

The cost of additional rework caused by choosing an easy (limited) solution now instead of using a better approach that would take longer

⚙️🛠