drtools-code health

If I download a project from GitHub, where are the biggest problems?

Where should I start the investigation?

Description

DR-Tools Code Health was created to be a simple tool that helps developers with their daily work.

DR-Tools Code Health enables deeper investigation of metrics and statistics, design issues (smells), smell co-occurrences, and ranking/prioritization of code elements, identifying the most problematic parts at various levels of granularity.

drtools-code health in action

Requirements and Install Instruction

  • Only requirement: JRE version 11
  • Download the tool and unzip it to a directory
  • We recommend adding the directory to your system PATH — and you're done!
  • More detailed information is available here

Main Features

  • Modes: Command-line (CLI, using --init and --analyze options) and interactive mode (command prompt)
  • 48 metrics contextualized by summary, namespaces, types, methods, dependencies, and coupling
  • Detects 15 smells at the granularities of namespace, type, and method
  • Detects 20 smell co-occurrences categorized by type, method, and inter-component relationships
  • Context-selected and sorted metrics
  • Customization via programming (fluent API) and configuration file
  • Statistical analysis of code
  • Supported languages: Java (for now)
  • Outputs in various formats: console, CSV, and JSON
  • Easy filtering of results using the --top option
  • Implements a prioritization model based on criteria such as severity, representativity, impact on quality, and degree of intervention. It also aggregates these criteria into a global indicator called the Code Disease Indicator (CDI), which highlights the most problematic code elements at a given granularity.
  • Download and run! More information available here.

Usage Modes

DR-Tools Code Health Execution Modes: The tool takes the project's source code as input, along with an optional project configuration file.

This configuration file contains developer-customized information to tailor the project's analyses. DR-Tools Code Health offers two usage modes: - **CLI mode**, using the --init and --analyze options, which creates directories, configuration files, and analysis results in CSV and JSON formats; - **Interactive mode**, which allows developers to analyze the project and explore metrics, statistics, smells, and prioritization via a command prompt.

More detailed information about the usage modes can be found here.

Internal Process

How does DR-Tools Code Health work internally?

Starting with the project's source code and an optional configuration file, the tool performs a series of steps: (1) loading the project's general information; (2) analyzing the code elements; (3) calculating metrics and statistics based on the current state; (4) loading detection heuristics for smells and co-occurrences using the previous information; (5) detecting smells and co-occurrences according to the heuristics; (6) computing rankings based on criteria such as severity and impact on quality; (7) prioritizing code elements using individual criteria and the aggregated CDI (Code Disease Indicator); and finally, (8) preparing the project data for output in file format (CLI mode) or for manipulation and querying via the prompt (interactive mode).

More detailed information about the modules can be found here.

How can I analyze source code with DR-Tools Code Health?

To demonstrate how DR-Tools Code Health can assist developers, we present a practical case using FindBugs. We proceed step by step, defining each objective and evaluating the results provided by the tool.

All the details can be found here.