CoDiver

AhmadHassan-BTedMIT更新放缓

统一分析代码质量、架构指标和敏捷研发数据的平台,支持 Python AST 解析与 Java 代码坏味检测,并用 Streamlit 仪表盘直观展示项目健康状况。

An advanced, unified platform for code quality, architectural metrics, and Agile analytics. Features Python AST parsing, Java static analysis (code smells), and interactive project health dashboards built with Streamlit.

暂无版本4,670star2fork同步于 2026-11-11 05:35 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/yourusername/CoDiver.git
cd CoDiver
pip install -r requirements.txt
streamlit run app.py
硬件要求按 README 说明

README 未说明,仅提到需容器化 Python 运行时,无法用 GitHub Pages 静态托管

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

统一分析代码质量、架构指标与敏捷数据的 Streamlit 平台,支持 Python 和 Java

统一分析代码质量、架构指标和敏捷研发数据的平台,支持 Python AST 解析与 Java 代码坏味检测,并用 Streamlit 仪表盘直观展示项目健康状况。

核心能力

  • 用 Python ast 与 radon 计算圈复杂度、认知复杂度与缺陷密度
  • 用 javalang 遍历 Java AST 检测上帝类、特性依恋等代码坏味道
  • 按扩展名自动路由 .py/.java/.json 到对应分析引擎
  • 用 pandas 与 plotly 生成冲刺燃尽、速率与范围蔓延可视化
  • 前端与后端分析引擎严格解耦,便于扩展新语言解析器

容易踩的坑

README 未给出依赖版本约束,requirements.txt 内容未列出;本地运行需自行执行 streamlit run app.py 启动服务,README 未说明默认端口;克隆地址中的 yourusername 需替换为实际仓库地址

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    CoDiver: Code Sniffer & Project Analyzer

    An advanced, open-source unified platform for code quality, architecture metrics, and Agile analytics.

    Version License Open Source Streamlit Python Live Demo

    [!NOTE] This project was previously known as SMC-Software-Metrics-Calculator.


    The Philosophy

    Software is inherently human. Behind every line of code, every architectural decision, and every sprint metric lies human effort and engineering intent. The CoDiver: Code Sniffer & Project Analyzer was built on the premise that technical debt shouldn't be an abstract concept - it should be deeply visible, understandable, and actionable.

    This platform bridges the gap between raw codebase complexity and human understanding. By unifying Python parsing, Java static analysis, and Agile process tracking into a single frictionless dashboard, the suite abstracts away the borders between languages and focuses purely on the code.


    Architecture Overview

    The platform operates on a Zero-Coupling, Event-Reactive Architecture. The frontend strictly delegates analysis to isolated backend engines, which parse raw files into Abstract Syntax Trees (ASTs) on the fly.

    graph TD
        classDef frontend fill:#1e3a8a,stroke:#3b82f6,stroke-width:2px,color:#fff;
        classDef controller fill:#475569,stroke:#94a3b8,stroke-width:2px,color:#fff;
        classDef engine fill:#0f172a,stroke:#10b981,stroke-width:2px,color:#fff;
        
        UI[ Streamlit Frontend]:::frontend -->|Unified File Upload| Controller[ Universal Control Center]:::controller
        
        Controller -->|Routes .py| PythonEngine[ Python AST Engine]:::engine
        Controller -->|Routes .java| JavaEngine[ Java AST Engine]:::engine
        Controller -->|Routes .json| AgileEngine[ Agile Process Engine]:::engine
        
        subgraph Core Analyzers
            PythonEngine --> PyMetrics[Complexity & Code Metrics]
            JavaEngine --> JavaSmells[Design & Implementation Smells]
            AgileEngine --> SprintMetrics[Velocity & Scope Creep]
        end
        
        PyMetrics --> Aggregator[ Results Aggregator]
        JavaSmells --> Aggregator
        SprintMetrics --> Aggregator
        
        Aggregator -->|Pandas DataFrames| UI
    

    Request Lifecycle & Data Flow

    Data flows deterministically from the browser, through the AST generators, into Pandas dataframes, and back out to Plotly visuals. The UI remains fully stateless until explicitly commanded to execute an analysis.

    sequenceDiagram
        participant User as Developer
        participant UI as  UI (app.py)
        participant Engine as  Analyzer Engine
        participant State as  Session State
        
        User->>UI: Uploads Source Code (.py, .java)
        UI->>UI: Auto-categorize by extension
        User->>UI: Adjusts Global Parameters
        User->>UI: Executes CoDiver Analysis
        
        UI->>Engine: Dispatches raw UTF-8 strings & configs
        
        rect rgb(30, 41, 59)
            Note right of Engine: Backend Processing Phase
            Engine->>Engine: Generate Abstract Syntax Trees
            Engine->>Engine: Traverse classes, fields, methods
            Engine->>Engine: Evaluate Code Smells & Constraints
        end
        
        Engine-->>State: Yield structured dictionaries
        State->>State: Transform to Pandas DataFrames
        State-->>UI: Triggers reactive re-render
        
        UI-->>User: Displays interactive visualizations
    

    Internal Module Structure

    The repository enforces a strict separation between UI logic and calculation algorithms to guarantee high cohesion and maintainability at scale.

    CoDiver/
    ├── app.py                      # Master Unified Controller & UI Entry Point
    ├── requirements.txt            # Dependency configuration
    └── src/
        ├── java_analyzer/          # Java Static Analysis Subsystem
        │   ├── analyzer_engine.py  # javalang AST traversal logic
        │   ├── dashboard.py        # Session state & execution handlers
        │   ├── detectors/          # Code Smell logic (Design, Naming, etc.)
        │   └── utils/              # UI components & helpers
        │
        └── software_metrics/       # Python & Agile Analytics Subsystem
            ├── calculators/        # Core calculation algorithms (COCOMO, Agile)
            ├── ui/                 # Visualization components (Charts, Cards)
            └── tests/              # Subsystem validation
    

    System Capabilities

    SubsystemCore ResponsibilitiesUnderlying Tech
    Code MetricsAST generation, Cyclomatic & Cognitive complexity mapping, Defect density prediction, COCOMO estimation.ast, radon
    Static ArchitectureGod Class detection, Feature Envy identification, naming conventions, Javadoc validation, raw LOC distributions.javalang
    Agile ProcessVelocity tracking, sprint burndown visualization, scope creep calculation.pandas, plotly
    Universal ControlUnified drag-and-drop ingestion, cross-language processing dispatch, dynamic parameter routing.streamlit

    Build & Deployment Pipeline

    Because this application leverages a robust Python backend for intensive AST processing, it is deployed natively via containerized Python runtimes (and cannot be served statically via standard GitHub Pages).

    Live Demo

    The platform is currently live and operational on Streamlit Community Cloud.

    Access the live suite here: codiver.streamlit.app

    Self-Hosting & Deployment

    Because this application leverages a robust Python backend for intensive AST processing, it is deployed natively via containerized Python runtimes.

    Deployment via Streamlit Cloud (Recommended)
    1. Fork this repository.
    2. Navigate to Streamlit Share.
    3. Connect your fork and point the main file path to app.py.
    4. The cloud environment will automatically parse requirements.txt and deploy your instance.

    Local Development Workflow

    To initialize the suite in a local development environment:

    # 1. Clone the repository
    git clone https://github.com/yourusername/CoDiver.git
    cd CoDiver
    
    # 2. Install AST parsers and UI dependencies
    pip install -r requirements.txt
    
    # 3. Boot the reactive frontend server
    streamlit run app.py
    

    Development & Contribution

    New ideas, architectural optimizations, and structural improvements are warmly welcomed. The system is designed to be highly extensible - adding support for a new language parser simply requires introducing a new module within src/ and wiring it to the Universal Control Center in app.py.

    When modifying the codebase, please ensure that UI concerns remain strictly separated from backend AST calculation logic.


    Engineering Credits

    Ahmad Hassan (B-Ted)
    Software Engineer

    This architecture was designed and engineered from the ground up to solve complex software quality tracking constraints using modern, event-driven Python web paradigms.

    License

    This repository is published under the MIT License, promoting open knowledge and collaborative engineering.