What is analyzed
The files of a run
A calculation reads the files of the scope you chose that meet all of these:
- They are source text. Compiled classes and binary files are not read, so the libraries of the project are not measured.
- They belong to the content of the project and are not in an excluded folder.
- If they are Java files, they are under a source root. A
.javafile in a resource folder is not analyzed, just as the code inspections of the IDE leave it out.
Test code is measured when the scope includes the test sources.
The calculation works on what the editor has, including changes you have not saved to disk.
Languages
| Java | Kotlin | |
|---|---|---|
| Measured | Always | With the Kotlin plugin of the IDE enabled |
| Which code | All of it | Kotlin for the JVM. .kts scripts and the code of other platforms (common, JavaScript, native) have no rows |
| Metrics | All | Every metric that applies to Kotlin, at every category |
Files of Kotlin that have no rows, and files of other types such as XML or HTML, still count in the metrics that count files and lines.
When a rule of a metric is different in Kotlin, the help of the metric says so (“Help for a metric”).
Categories
The results have one table per category, and an element gets a row in the table of its kind:
| Category | One row per |
|---|---|
| Method | Method or constructor. In Kotlin, also function, written accessor and secondary constructor |
| Class | Class, including enums, records and nested classes |
| Interface | Interface |
| Package | Package with measured code |
| Module | Module of the project |
| File type | Type of file, as the IDE classifies them |
| Project | The project: a single row |
Anonymous and local classes have no row of their own.
Not every metric applies to every element of its category: one may measure only concrete classes, another only methods with a body. Where a metric does not apply, the cell is empty.
A table only has the rows the scope reaches: measuring one package gives the method, class and interface rows of that package.
How rows are named
| Element | Name | Example |
|---|---|---|
| Class or interface | Its qualified name | com.acme.core.Box |
| Method | The name of its class, its own name and the types of its parameters | com.acme.core.Box.get(), Main.main(String[]) |
| Package | Its name | com.acme.core |
| Module | Its name in the project | core |
| File type | The description the IDE gives it | |
| Project | Project |
Kotlin declarations are named as they are written in Kotlin:
| Declaration | Row |
|---|---|
fun f() at the top level of p/K.kt |
p.KKt.f() |
A member fun m(n: Int) of class p.C |
p.C.m(Int) |
An extension fun String.ext(n: Int) in p/K.kt |
p.KKt.String.ext(Int) |
A secondary constructor of p.C |
p.C.constructor(String) |
The accessor of val twice in p.C |
p.C.twice.get() |
The same names identify each element in the exports and in the snapshots. The two exceptions are the file types
and the project, which those files write with a fixed name that does not depend on the language: the name of the
file type in the IDE, such as JAVA, and project.
Because the name is the identity of an element, a comparison shows a renamed or moved element as one removed and one new.
What is not there
Stau Metro measures the source code as it is written. It does not run the code or the tests, so it has no execution figures such as test coverage, and it does not read the history of version control.