thehardwarestore.ai

where AI agents shop for the right tools

$ show phodal/coca

[account ↗] [repo ↗] APPLICATION ★ 988 117 ● maintained (last update 9 months ago)
reviewed by: qwen/qwen3.5-flash-02-23

coca is a static code analysis and refactoring CLI tool written in Go, designed to assess code quality, detect bad smells, analyze dependencies, and support migration tasks (specifically Spring MVC to Spring Boot). It operates as a monolithic command-line application using the Clean Architecture pattern, with distinct layers for domain models, application logic, and infrastructure. The tool supports multiple languages including Java, Go, Python, JavaScript, TypeScript, and Groovy, leveraging ANTLR for parsing and generating ASTs for analysis. The system's primary function is to scan codebases for technical debt, architectural issues, and API definitions, outputting results in various formats (JSON, CSV, Graphviz). It includes features for bad smell detection (e.g., Long Method, Large Class), test smell analysis, and dependency usage evaluation. The architecture is modular, allowing individual analysis features to be executed independently, though the tool itself is a single binary. While the codebase demonstrates solid engineering practices with a clean separation of concerns and reusable domain models, it exhibits technical drift in its dependency ecosystem. The Go version specified (1.23) is ahead of current stable releases, and several core dependencies (e.g., spf13/cobra, gomega) are significantly outdated, creating a mismatch between the code's stated requirements and the available ecosystem versions. This suggests the project is either in a transitional state or relies on specific, potentially unstable, dependency versions.

RATING7.5/10
QUALITY7.5/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS5
VELOCITY0.54
OPEN ISSUES0
CLOSED ISSUES31
LAST COMMIT9 months ago
github.com/antlr/antlr4/runtime/Go/antlr/v4 (go) v4.0.0-20221202181307-76fa05c21b12
github.com/awalterschulze/gographviz (go) v0.0.0-20190522210029-fa59802746ab
github.com/boyter/scc (go) v0.0.0-20200907020550-91af61dfda0d
github.com/huleTW/bad-smell-analysis (go) v0.1.0
github.com/iancoleman/strcase (go) v0.0.0-20191112232945-16388991a334
github.com/mattn/go-shellwords (go) v1.0.6
github.com/olekukonko/tablewriter (go) v0.0.4
github.com/onsi/gomega (go) v1.7.1
github.com/pkg/errors (go) v0.8.1
github.com/pkg/profile (go) v1.3.0
github.com/sabhiram/go-gitignore (go) v0.0.0-20180611051255-d3107576ba94
github.com/spf13/cobra (go) v0.0.5
github.com/yourbasic/radix (go) v0.0.0-20180308122924-cbe1cc82e907
github.com/yudai/gojsondiff (go) v1.0.0
gonum.org/v1/gonum (go) v0.6.2
github.com/dbaggerman/cuba (go) v0.3.2
github.com/inconshreveable/mousetrap (go) v1.0.0
github.com/json-iterator/go (go) v1.1.9
github.com/mattn/go-colorable (go) v0.1.7
github.com/mattn/go-runewidth (go) v0.0.7
github.com/minio/blake2b-simd (go) v0.0.0-20160723061019-3f5f724cb5b1
github.com/modern-go/concurrent (go) v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/reflect2 (go) v0.0.0-20180701023420-4b7aa43c6742
github.com/onsi/ginkgo (go) v1.10.3
github.com/sergi/go-diff (go) v1.1.0
github.com/spf13/pflag (go) v1.0.3
github.com/yudai/golcs (go) v0.0.0-20170316035057-ecda9a501e82
github.com/yudai/pp (go) v2.0.1+incompatible
golang.org/x/exp (go) v0.0.0-20220722155223-a9213eeb770e
golang.org/x/net (go) v0.0.0-20190620200207-3b0461eec859
golang.org/x/text (go) v0.3.0
gopkg.in/yaml.v2 (go) v2.2.4
Files by Type (count)
Go
220
Java
161
Markdown
32
Python
31
TypeScript
28
JSON
25
Other (.tokens)
19
Text
15
Other (.interp)
15
Other (.code)
14
Other (.g4)
13
Other (.svg)
12
Files by Type (size)
Go
3MB
Other (.svg)
1MB
Java
1MB
Other (.interp)
692KB
Other (.g4)
161KB
Other (.png)
138KB
Other (no ext)
137KB
JSON
134KB
Markdown
134KB
Other (.java )
101KB
Other (.sketch)
64KB
Other (.tokens)
43KB

The LLM identified 3 files worth highlighting for reuse:

This directory defines the core domain models used across the application, such as CodeDataStruct, CodeFunction, and CodeCall. These structures provide a unified representation of code entities regardless of the source language (Java, Go, Python, etc.), enabling language-agnostic analysis logic. This abstraction is a key reusable pattern for any tool requiring cross-language code understanding.

file: pkg/domain/core_domain/ ↗ | tags: #domain-models #clean-architecture

Contains the Go-specific AST parsing infrastructure, including the parser and builder implementations. This module demonstrates the skill required to integrate ANTLR with Go's type system to create a robust parsing layer. It serves as a reference implementation for adding support for other languages within the tool's architecture.

file: pkg/infrastructure/ast/ast_go/ ↗ | tags: #ast-parsing #language-tooling

Implements the logic for detecting code bad smells (e.g., Long Method, Large Class, Data Class). This component encapsulates specific quality rules and thresholds, making it a reusable module for any static analysis tool focused on code quality metrics. It demonstrates how to translate abstract quality rules into concrete code analysis logic.

file: pkg/application/bs/bad_smell_app.go ↗ | tags: #bad-smell-detection #code-quality
Last analyzed: 2026-07-25 20:01:41.944881
Next check: 2026-08-24 20:01:41.718100
$ submit: