Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Static Analysis & Code Quality
  3. ck

ck

Apache-2.0Java

A Java library for calculating class-level and method-level code metrics via static analysis, without requiring compiled code.

GitHubGitHub
453 stars168 forks0 contributors

What is ck?

CK is a Java library and command-line tool that calculates a wide range of code metrics through static analysis of source code. It helps developers and researchers measure software quality attributes like coupling, cohesion, complexity, and size without needing to compile the code.

Target Audience

Java developers, software engineering researchers, and teams focused on code quality analysis, refactoring, and technical debt management.

Value Proposition

CK provides a comprehensive, extensible, and accurate metric suite using pure static analysis, avoiding the overhead and dependencies of bytecode analysis, and is easily integrable into build pipelines or research workflows.

Overview

Code metrics for Java code by means of static analysis

Use Cases

Best For

  • Analyzing code quality and technical debt in Java projects
  • Research studies on software metrics and their correlations
  • Integrating code metric collection into CI/CD pipelines
  • Identifying refactoring candidates based on coupling and cohesion
  • Educational purposes for teaching software measurement
  • Building custom static analysis tools on top of its extensible framework

Not Ideal For

  • Teams requiring real-time, interactive code quality feedback within an IDE, as CK operates via command-line or library integration without live analysis features.
  • Projects in languages other than Java, since CK is specifically designed for static analysis of Java source code only.
  • Environments with strict memory constraints, as CK's AST parsing can be memory-intensive for large codebases, requiring tuning of 'max files per partition'.
  • Scenarios where bytecode-level accuracy is essential, as CK's static analysis may miss dynamic behaviors or fail on unresolved method overloading.

Pros & Cons

Pros

Comprehensive Metric Suite

Calculates over 30 metrics including CBO, DIT, LCOM, and unique word counts, providing extensive insights into code quality without needing compilation, as detailed in the README.

Static Analysis Efficiency

Analyzes Java source code directly using Eclipse JDT, eliminating the dependency on compiled bytecode and simplifying setup, as it operates solely on .java files.

Extensible Architecture

Uses Visitor and Factory patterns, allowing developers to easily add custom metrics by implementing ClassLevelMetric or MethodLevelMetric interfaces, making it adaptable for research or custom tools.

Flexible Integration

Can be run as a standalone command-line tool or integrated as a Maven dependency, catering to both ad-hoc analysis and automated CI/CD pipelines, with examples provided in the README.

Cons

Memory Intensive Processing

The README notes that users may need to tune 'max files per partition' to avoid out-of-memory errors, indicating scalability issues with large projects and complex AST parsing.

Incomplete Metric Reliability

As admitted in the README, some metrics like LCOM are not reliable, and others like RFC can fail in cases of method overloading, limiting accuracy for certain code patterns.

Java-Only Support

CK is limited to Java projects, so it cannot be used for multi-language codebases or other programming languages, restricting its applicability in polyglot environments.

Setup Complexity for Dependencies

Using JAR files for better type resolution requires manual configuration, and the tool may not handle all dependency scenarios seamlessly, as noted in the 'use jars' parameter description.

Frequently Asked Questions

Quick Stats

Stars453
Forks168
Contributors0
Open Issues24
Last commit2 months ago
CreatedSince 2015

Tags

#code-metrics#software-quality#java#ast-parsing#technical-debt#maven#static-analysis#metrics#software-engineering

Built With

M
Maven
J
Java

Included in

Static Analysis & Code Quality14.5k
Auto-fetched 6 hours ago

Related Projects

PHP ParserPHP Parser

A PHP parser written in PHP

Stars17,452
Forks1,129
Last commit12 days ago
TypeScript ESLintTypeScript ESLint

:sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript

Stars16,320
Forks2,952
Last commit23 hours ago
pyrightpyright

Static Type Checker for Python

Stars15,545
Forks1,797
Last commit2 days ago
ReviewdogReviewdog

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

Stars9,474
Forks490
Last commit8 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub