Reference

Documentation

Every km command with its options, its formulas and sample output, plus the configuration and the supported languages.

Two conventions hold for every command:

  • --top N limits the rows of a table (20 by default), and JSON only when given; the totals of a table, the short and terse summaries and the CI annotations (github, codeclimate) always cover every file. A totals row over more files than it shows says so: Total (30 files, 20 shown).
  • Paths are shown relative to the root of the git repository, or to the analyzed directory outside one, without a leading ./, whatever directory km runs from and however the path argument is written, so the output of two commands can be joined.

Getting started

Installation
Install the km binary and the completions for your shell.
Configuration
The .kimun.toml file: thresholds, quality gates and how to generate it with km init.

Static metrics

km score
Code health score
km loc
Count lines of code
km dups
Detect duplicate code
km cycom
Cyclomatic complexity
km cogcom
Cognitive complexity
km indent
Indentation complexity
km hal
Halstead complexity metrics
km mi
Maintainability Index (Visual Studio variant)
km miv
Maintainability Index (verifysoft variant)
km smells
Code smell detection
km deps
Dependency graph analysis
km docs
Dead references, the graph of notes, agent context and documents behind the code
km infra smells
Security smells of infrastructure code
km map
Enclosure diagram of the code
km report
Comprehensive metrics report

History in git

km hotspots
Hotspot analysis
km churn
Code churn analysis
km knowledge
Code ownership analysis
km authors
Per-author ownership summary
km tc
Temporal coupling analysis
km impact
Impact of a diff
km age
File age analysis

Tools

km ai
Skill and analysis for coding agents

Reference

Supported languages
The languages Kimün recognizes and how it counts each file.
References
The books and papers behind the metrics of Kimün.