{"id":27357702,"url":"https://github.com/helabenkhalfallah/code-health-meter","last_synced_at":"2025-04-12T23:53:55.904Z","repository":{"id":241704892,"uuid":"805305978","full_name":"helabenkhalfallah/code-health-meter","owner":"helabenkhalfallah","description":"code-health-meter is a comprehensive tool designed to measure and monitor the health of a codebase (JavaScript/TypeScript). It provides a quantitative evaluation of your code's maintainability, complexity, and size using a variety of established software metrics.","archived":false,"fork":false,"pushed_at":"2025-03-24T08:29:24.000Z","size":2738,"stargazers_count":27,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T23:53:49.676Z","etag":null,"topics":["code-analysis","code-analysis-tool","cyclomatic-complexity","halstead-metrics","javascript","maintenability-index","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/helabenkhalfallah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-05-24T09:51:59.000Z","updated_at":"2025-04-10T16:48:23.000Z","dependencies_parsed_at":"2024-06-15T17:23:32.717Z","dependency_job_id":"e45eff6a-6ce4-403d-a8c8-23ce8fd6d3e7","html_url":"https://github.com/helabenkhalfallah/code-health-meter","commit_stats":null,"previous_names":["helabenkhalfallah/codehealthmeter","helabenkhalfallah/code-health-meter"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helabenkhalfallah%2Fcode-health-meter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helabenkhalfallah%2Fcode-health-meter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helabenkhalfallah%2Fcode-health-meter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helabenkhalfallah%2Fcode-health-meter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helabenkhalfallah","download_url":"https://codeload.github.com/helabenkhalfallah/code-health-meter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647236,"owners_count":21139083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["code-analysis","code-analysis-tool","cyclomatic-complexity","halstead-metrics","javascript","maintenability-index","typescript"],"created_at":"2025-04-12T23:53:55.362Z","updated_at":"2025-04-12T23:53:55.860Z","avatar_url":"https://github.com/helabenkhalfallah.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📊 Code Health Meter\n\n## 📖 Table of Contents\n\n1. [📢 Presentation](#-presentation)\n2. [⚙️ Installation and Usage](#️-installation-and-usage)\n3. [🤝 Contributing](#-contributing)\n4. [📜 License](#-license)\n\n---\n\n## 📢 Presentation\n\n**Code Health Meter** is a **powerful and intelligent tool** 🧠 designed to analyze and enhance code quality. It evaluates key software metrics such as:\n\n- **Maintainability** 🔄 – How easy the code is to update and extend.  \n- **Complexity** 🔍 – Measures the difficulty of understanding and modifying the code.  \n- **Duplication** 🔁 – Detects repeated code blocks that can be optimized.  \n- **Coupling** 🔗 – Analyzes dependencies between modules to assess modularity.  \n\nBy leveraging well-established methodologies, including **Halstead Metrics, Cyclomatic Complexity, Maintainability Index, and Graph-Based Metrics**, this tool helps developers **identify potential risks** ⚠️ and **refactoring opportunities** ✨ in their codebase.\n\n### 🚀 Key Features:\n\n- **Quantitative Code Quality Analysis** – Uses mathematical models to assess maintainability, difficulty, and potential bugs.  \n- **Cyclomatic Complexity Calculation** – Evaluates control flow to determine function complexity.  \n- **Maintainability Index Assessment** – Provides insights into how easy the code is to maintain and extend.  \n- **Code Duplication Detection** – Implements the **Rabin–Karp algorithm** to identify redundant code blocks.  \n- **Graph-Based Software Metrics** – Analyzes dependencies and modularity using **Louvain Communities** and centrality measures.  \n- **Automated Report Generation** – Outputs results in **JSON and HTML formats** for easy visualization.  \n\n---\n\n## ⚙️ Installation and Usage\n\n### 📌 Prerequisites\nBefore installing **Code Health Meter**, make sure you have the following dependencies installed:\n\n- **Node.js** 🌐 – Required for running the tool.\n- **Graphviz** 📈 – Needed for graph-based analysis. (On macOS, install via `brew install graphviz` or `port install graphviz`)\n\n### 📥 Installation\nInstall **Code Health Meter** as a development dependency:\n\n```sh\nnpm i -D code-health-meter\n```\n\n### 🚦 Running the Analysis\nTo analyze a project, run:\n\n```sh\nnpx code-health-meter --srcDir \"../../my-path\" --outputDir \"../../my-output-path\" --format \"json or html\"\n```\n\nAfter execution, you will find all generated reports inside the specified `outputDir`.  \n\n📂 **Example Reports:** A sample project analysis with JSON and HTML reports is available in the `tests` folder.\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! 🎉 If you'd like to improve **Code Health Meter**, follow these steps:\n\n1. **Fork the repository and clone it locally:**\n    ```sh\n    git clone https://github.com/helabenkhalfallah/code-health-meter.git\n    cd code-health-meter\n    ```\n\n2. **Install dependencies:**\n    ```sh\n    npm install\n    ```\n\n3. **Run a local analysis:**\n    ```sh\n    npm run scan --srcDir \"../../my-path\" --outputDir \"../../my-output-path\" --format \"json or html\"\n    ```\n\n   **Using PNPM?** No problem! 🚀\n    ```sh\n    pnpm scan --srcDir \"../../my-path\" --outputDir \"../../my-output-path\" --format \"json or html\"\n    ```\n\n---\n\n## 📜 License\n\nThis project is licensed under the **MIT License** 📄. See the [LICENSE](LICENSE) file for details.\n\n---\n\n### ❓ Need Help?\n\n💬 If you encounter any issues or have questions, feel free to open an [issue](https://github.com/helabenkhalfallah/code-health-meter/issues) or start a discussion in the repository! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelabenkhalfallah%2Fcode-health-meter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelabenkhalfallah%2Fcode-health-meter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelabenkhalfallah%2Fcode-health-meter/lists"}