{"id":50798061,"url":"https://github.com/iannil/code-lint-x","last_synced_at":"2026-06-12T16:04:13.664Z","repository":{"id":334527893,"uuid":"1141683315","full_name":"iannil/code-lint-x","owner":"iannil","description":"CODE-LINT-X is a static code analysis tool that detects Concept Compression in software architecture — when data fields (especially enums and integer fields) carry too many responsibilities, leading to complex conditional logic and maintainability issues.","archived":false,"fork":false,"pushed_at":"2026-01-25T10:16:13.000Z","size":235,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-26T01:07:05.056Z","etag":null,"topics":["analysis","code","lint"],"latest_commit_sha":null,"homepage":"https://zhurongshuo.com/products/code-lint-x/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iannil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-25T08:27:47.000Z","updated_at":"2026-01-25T11:21:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/iannil/code-lint-x","commit_stats":null,"previous_names":["iannil/code-lint-x"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/iannil/code-lint-x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iannil%2Fcode-lint-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iannil%2Fcode-lint-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iannil%2Fcode-lint-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iannil%2Fcode-lint-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iannil","download_url":"https://codeload.github.com/iannil/code-lint-x/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iannil%2Fcode-lint-x/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34251782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","code","lint"],"created_at":"2026-06-12T16:04:08.943Z","updated_at":"2026-06-12T16:04:13.659Z","avatar_url":"https://github.com/iannil.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CODE-LINT-X\n\n\u003e Stop guessing what `status == 3` means.\n\n[![Crates.io](https://img.shields.io/crates/v/code-lint-x)](https://crates.io/crates/code-lint-x)\n[![Documentation](https://docs.rs/code-lint-x/badge.svg)](https://docs.rs/code-lint-x)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**CODE-LINT-X** is a static code analysis tool that detects **Concept Compression** in software architecture — when data fields (especially enums and integer fields) carry too many responsibilities, leading to complex conditional logic and maintainability issues.\n\nBased on the principle *\"Data Redundancy \u003e Control Complexity\"*, CODE-LINT-X helps teams identify and refactor \"Global Enums\" that silently erode code quality.\n\n---\n\n## The Problem\n\n```java\n// Anti-pattern: Concept Compression\nif (order.type == 4) { ... }  // What is type 4?\n\n// The enum has 15 values, used in 47 places across 12 packages\nenum OrderType {\n    NORMAL, PREORDER, VIRTUAL, PRESALE, GROUP, FLASH_SALE, ...\n}\n```\n\n**This leads to:**\n\n- :hourglass: Cognitive overload when reading code\n- :bug: Hidden bugs from misunderstood meanings\n- :snail: Difficult maintenance and testing\n- :x: High coupling across modules\n\n---\n\n## The Solution\n\n```java\n// Explicit, self-documenting data\nif (order.is_virtual) { ... }\nif (order.requires_payment) { ... }\nif (order.is_group_order) { ... }\n```\n\n\u003e *\"The storage cost of an extra field is far less than the cognitive cost of maintaining if/else chains.\"*\n\n---\n\n## Features\n\n### Core Detectors\n\n| Detector | Description |\n|----------|-------------|\n| **Global Enum Detector** | Identifies enums with excessive responsibilities using Compression Index |\n| **Comment Smell Detector** | Finds explanatory comments that indicate poor design (`// special case`, `// TODO`, etc.) |\n| **Context-Aware Filtering** | Reduces false positives by recognizing legitimate patterns (state machines, factory patterns) |\n\n### Multi-Language Support\n\n| Language | Status | Features |\n|----------|--------|----------|\n| :coffee: Java | :white_check_mark: Full | Enums, constants, switch/if statements |\n| :gopher: Go | :white_check_mark: Full | iota constants, interfaces |\n| :typescript: TypeScript | :white_check_mark: Full | Enums, union types, literal types |\n| :snake: Python | :white_check_mark: Full | Enum classes, old-style constants |\n\n### Team Collaboration\n\n- :chart_with_upwards_trend: **Trend Tracking** — Track complexity evolution over time\n- :dashboard: **Team Dashboard** — Module health scores, Top 10 riskiest fields\n- :hammer: **Refactoring Suggestions** — AI-free heuristic recommendations with before/after examples\n- :chart: **Impact Analysis** — Change scope, risk level, estimated effort, migration plan\n\n### CI/CD Integration\n\n- Git hooks (pre-commit, pre-push)\n- GitHub Actions compatible\n- JSON/HTML report formats\n- Configurable thresholds via `.codelintrc`\n\n---\n\n## Installation\n\n### From Crates.io (Recommended)\n\n```bash\ncargo install code-lint-x\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/iannil/code-lint-x.git\ncd code-lint-x\ncargo install --path .\n```\n\n---\n\n## Quick Start\n\n### Basic Scan\n\n```bash\n# Scan your project\ncode-lint-x scan ./src\n\n# Generate HTML report\ncode-lint-x scan ./src --format html --output report.html\n\n# JSON output for CI/CD\ncode-lint-x scan ./src --format json --output results.json\n```\n\n### Configuration\n\nCreate `.codelintrc` in your project root:\n\n```toml\n[thresholds]\ncompression_index = \"warning:30, error:60\"\n\n[detector.god_enum]\nenabled = true\nmin_enum_values = 3\n\n[detector.comment_smell]\nenabled = true\nkeywords = [\"special case\", \"except\", \"temporary\", \"hack\", \"TODO\"]\n\n[ignore]\npaths = [\"generated/\", \"vendor/\", \"*_test.go\"]\n\n[output]\nformat = \"json\"\nsort_by = \"severity\"\n```\n\n### Git Hooks\n\n```bash\n# Install pre-commit hook\ncode-lint-x hook install\n\n# Uninstall hooks\ncode-lint-x hook uninstall\n```\n\n### Trend Analysis\n\n```bash\n# View trends over time\ncode-lint-x trend --since \"1 month ago\"\n\n# Group by module\ncode-lint-x trend --by-module\n\n# Group by author\ncode-lint-x trend --by-author\n```\n\n---\n\n## Compression Index\n\nThe **Compression Index** measures how much responsibility a single field carries:\n\n```\nCompression Index = (Control Flow References × Unique Packages) / Enum Values\n```\n\n| Index | Level | Action |\n|-------|-------|--------|\n| 0-20 | :white_check_mark: Healthy | No action needed |\n| 20-40 | :warning: Warning | Consider refactoring |\n| 40+ | :x: Critical | Refactoring recommended |\n\n---\n\n## Example Output\n\n```\nSCANNING: /path/to/project\n├── Found 23 suspect enums\n├── Found 47 comment smells\n\n┌─ Global ENUM DETECTION ────────────────────────────────────┐\n│                                                            │\n│  OrderType (order/Order.java:42)                           │\n│  ├── Compression Index: 87.3  :x: CRITICAL                 │\n│  ├── 15 enum values                                        │\n│  ├── 47 control flow references                            │\n│  ├── Used in 12 packages                                   │\n│  │                                                         │\n│  Suggested Refactoring:                                    │\n│  ├─ Split into: is_virtual, is_preorder, is_group          │\n│  ├─ New enums: FulfillmentMode, PaymentMethod              │\n│  └─ Expected compression: 87.3 → 12.4                      │\n│                                                            │\n└────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## CLI Reference\n\n```bash\ncode-lint-x \u003cCOMMAND\u003e [OPTIONS]\n\nCOMMANDS:\n    scan        Scan source code for concept compression\n    trend       Show trend analysis over time\n    dashboard   Generate team dashboard\n    hook        Manage git hooks\n    config      Configuration management\n    init        Initialize configuration file\n    help        Show this help message\n\nSCAN OPTIONS:\n    -p, --path \u003cPATH\u003e           Path to scan [default: .]\n    -f, --format \u003cFORMAT\u003e       Output format: text|json|html [default: text]\n    -o, --output \u003cFILE\u003e         Write output to file\n    -c, --config \u003cFILE\u003e         Config file [default: .codelintrc]\n    --since \u003cCOMMIT\u003e            Incremental scan since commit\n```\n\n---\n\n## Architecture\n\n```\nsrc/\n├── analyzer/      # Smart refactoring suggestions\n│   ├── suggester.rs    # Generate actionable recommendations\n│   ├── impact.rs       # Analyze change impact and scope\n│   └── context.rs      # Context-aware filtering\n├── cli/           # Command-line interface\n├── config/        # Configuration file parser\n├── core/          # AST definitions, tracer, metrics\n├── detector/      # Detection algorithms\n│   ├── god_enum.rs     # Compression index calculator\n│   └── comment_smell.rs # Comment pattern matcher\n├── integration/   # Git hooks, CI/CD\n├── lang/          # Language-specific parsers\n│   ├── java/\n│   ├── go/\n│   ├── typescript/\n│   └── python/\n├── report/        # Report generation\n│   ├── trend.rs        # Historical trend tracking\n│   └── dashboard.rs    # Team dashboard HTML\n└── scanner/       # Project scanner orchestrator\n```\n\n---\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n---\n\n## Development\n\n```bash\n# Clone the repo\ngit clone https://github.com/iannil/code-lint-x.git\ncd code-lint-x\n\n# Run tests\ncargo test\n\n# Run with debug output\ncargo run -- scan ./tests/fixtures --format json\n\n# Format code\ncargo fmt\n\n# Run linter\ncargo clippy\n```\n\n---\n\n## Philosophy\n\n\u003e \"Your code is trying to tell you something. Are you listening?\"\n\nWe use linters to check syntax errors. But who checks for **design rot**?\n\nCODE-LINT-X is the first static analysis tool focused on **Concept Compression** — the silent killer of software architecture.\n\nDon't let an `Integer` destroy your architecture. **Decompress it.**\n\n---\n\n## License\n\n[MIT License](LICENSE)\n\n---\n\n## Links\n\n- [Documentation](docs/index.md)\n- [Project Status](docs/project/status.md)\n- [Architecture](docs/project/architecture.md)\n- [Book](https://zhurongshuo.com/practices/season-4/data-as-the-boundary/) — *Data as Boundary: Refactoring Software Complexity*\n\n---\n\n## Acknowledgments\n\nInspired by:\n\n- *Yoni Goldberg's* [Node.js Best Practices](https://github.com/goldbergyoni/nodebestpractices)\n- *Martin Fowler's* [Refactoring](https://refactoring.com/)\n- *Michael Feathers'* Working Effectively with Legacy Code\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiannil%2Fcode-lint-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiannil%2Fcode-lint-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiannil%2Fcode-lint-x/lists"}