A VSCode Marketplace published extension designed to help developers gain insights into the quality & quantity of comments in their code. This extension analyzes comments in C, C++, Python, JavaScript and Java files, providing metrics & visualizations to enhance code documentation practices.
- Comment Coverage Analysis: Calculates the percentage of lines that are comments out of the total non-blank lines.
- Language Detection: Automatically detects the programming language (C, C++, Python, JavaScript, Java) and tailors the analysis accordingly.
- Detailed Comment Breakdown: Provides a breakdown of single-line and multi-line comments, and their distribution visualized in a pie chart.
- Comment Length Analysis: Analyzes the length of comments and visualizes it over the range of lines in the file as a line chart.
- Word Cloud Generation: Generates a word cloud of the most frequently used words in the comments, with the size of the word indicating its frequency.
- Interactive Report Generation: Generates an HTML report with charts and tables summarizing the comment analysis.
- Open a C, C++, Python, JavaScript, or Java file in VSCode.
- Press
Ctrl+Shift+Pto open the command palette.
- Type
Analyze Commentsand select the command to start the analysis.
- The extension will analyze the comments in the current file and generate a report in a new HTML file.
- Open the HTML file to view the detailed analysis of comments in the file.
The extension generates an HTML report with the following sections:
- Comment Coverage Analysis: Displays the percentage of comment lines, total comments, and total lines in the file.
- Charts:
- Comment Types Distribution: A pie chart showing the distribution of single-line and multi-line comments.
- Comment Length: A line chart showing the length of comments across the file's lines.
- Word Cloud: A visual representation of the most frequent words found in comments.
- Comment Details: A table listing each comment, its type (single-line or multi-line), and its location in the code.
- Input File Code Snippet: A code snippet of the input file with a copy-to-clipboard button.
Screenshots of the generated report:
- Clone this repository to your local machine.
- Open the project in VSCode.
- Press
F5to start debugging the extension. - The extension will launch in a new VSCode window where you can test its functionality.
Contributions are welcome! Please follow these steps:
- Fork this repository.
- Clone your forked repository to your local machine.
- Create a new branch for your feature or bugfix.
- Make your changes & commit them with descriptive messages.
- Submit a pull request/merge request.
- Make the necessary changes.
- Update the version number in the
package.jsonfile. - Run
vsce packageto create a new.vsixfile. - Publish the new version to the VSCode Marketplace using the
vsce publishcommand.
Crystal Clear Comments is designed to give developers clear insights into their code documentation, making it easier to maintain and understand codebases over time. Enjoy coding with crystal-clear clarity!









