Skip to content

ScalaMetrics

The most comprehensive code metrics and analysis library for Scala

Release Maven Central CI Scala versions License

ScalaMetrics is a powerful static analysis library for Scala projects. It provides comprehensive analysis at multiple granularity levels: project, package, file, method, and member.

Features

  • Multi-Level Analysis: Extract metrics at project, package, file, method, and member levels
  • Comprehensive Metrics:
    • Cyclomatic complexity
    • Nesting depth
    • Expression branch density
    • Pattern matching
    • Lines of code
    • Documentation coverage
    • Parameter and arity (implicit, using, default, varargs)
    • Return type explicitness
    • Inline and implicit usage
  • Raw and Aggregated Metrics: Provides both raw and aggregated metrics for detailed insights
  • Multiple Dialect Support: Supports Scala 2.12, 2.13, and 3
  • Immutable Design: Functional pipeline architecture with immutable data flow
  • ScalaMeta-Powered: Leverages ScalaMeta for accurate AST parsing and traversal
  • Automatic Dialect Detection: Automatically detects Scala dialects for accurate parsing using a combination of heuristics and statistical methods

Please refer to the Getting Started guide for installation instructions and quick start examples. You can also explore the Metrics Overview to learn about the various metrics provided by ScalaMetrics and see how they can help improve your code quality.

Contributing

Contributions are welcome! Please see CONTRIBUTING for guidelines.

License

Licensed under the MIT License. See LICENSE file for details.

Acknowledgments

Built with: ScalaMeta - Scala metaprogramming library