Skip to content

Commit 0112b4a

Browse files
committed
update readme
1 parent 99c24d0 commit 0112b4a

File tree

1 file changed

+39
-29
lines changed

1 file changed

+39
-29
lines changed

README.md

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
<p align="center">
23
<a href="https://scrutinizer-ci.com/g/savinmikhail/Comments-Density/?branch=main">
34
<img src="https://scrutinizer-ci.com/g/savinmikhail/Comments-Density/badges/quality-score.png?b=main" alt="Quality Score">
@@ -6,61 +7,68 @@
67
<img src="https://scrutinizer-ci.com/g/savinmikhail/Comments-Density/badges/coverage.png?b=main" alt="Code Coverage">
78
</a>
89
<a href="https://scrutinizer-ci.com/g/savinmikhail/Comments-Density/?branch=main">
9-
<img src="https://scrutinizer-ci.com/g/savinmikhail/Comments-Density/badges/build.png?b=main" alt="Build status">
10+
<img src="https://scrutinizer-ci.com/g/savinmikhail/Comments-Density/badges/build.png?b=main" alt="Build Status">
1011
</a>
1112
<a href="https://dashboard.stryker-mutator.io/reports/github.com/savinmikhail/Comments-Density/main">
12-
<img src="https://img.shields.io/endpoint?style=flat&amp;url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fsavinmikhail%2FComments-Density%2Fmain" alt="Mutation testing badge">
13+
<img src="https://img.shields.io/endpoint?style=flat&amp;url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fsavinmikhail%2FComments-Density%2Fmain" alt="Mutation Testing Badge">
1314
</a>
1415
</p>
1516

1617
# Comments Density Analyzer
1718

18-
You might want to use it to control in CI/CD spreading of todos and fixmes in the codebase.
19+
The **Comments Density Analyzer** is a tool to help you monitor and manage comments in your codebase.
1920

20-
Or you might want to spot simple (regular) comments, which might be there to explain some shitty code or be the commented out code
21+
### Why Use It?
2122

22-
Or you might want to enforce some docblocks (I worked in companies, where each class and method were required to have docblock explaining purpose et al.)
23+
- **Control TODOs and FIXMEs in CI/CD**: Ensure these comments are not proliferating unchecked in your codebase.
24+
- **Spot Problematic Comments**: Identify regular comments explaining "shitty code" or remnants of commented-out code.
25+
- **Enforce Documentation Standards**: Require docblocks for classes and methods to maintain clear, consistent documentation.
2326

24-
All of this is possible by utilizing plugins system (see example in docs)
27+
All of this is made possible with a powerful **plugin system** (see the documentation for examples).
2528

2629
## Features
2730

28-
- **Multiple Comment Types**: Supports identification and analysis of several comment types including regular,
29-
docblocks, TODOs, FIXMEs, and license information.
30-
- **Detailed Reporting**: Quickly find code spots where changes might be necessary.
31-
- **Quality Check**: Set up a configuration file, and if thresholds aren't met, the exit code will be returned with the report.
32-
- **Configurable Reports**: Get results in either console or HTML file.
33-
- **Baseline**: Filter collected comments against a baseline to ignore old technical debt and focus on new issues.
34-
- **Plugins**: You can implement any logic for processing found comments in your plugins via simple interface
31+
- **Multiple Comment Types**: Detect and analyze regular comments, docblocks, TODOs, FIXMEs, and license headers.
32+
- **Plugin Support**: Extend functionality by creating custom plugins via a simple interface.
33+
- **Detailed Reporting**: Quickly identify areas of your code that need attention.
34+
- **Thresholds and Exit Codes**: Set thresholds for comment types and return an exit code when they are exceeded.
35+
- **Configurable Reports**: Output results to the console or as an HTML report.
36+
- **Baseline Support**: Filter out known technical debt using a baseline file and focus on new issues.
3537

36-
### Output Example
38+
### Output Example
3739
![Output Example](./example_for_readme.png)
3840

39-
### Installation
41+
---
42+
43+
## Installation
4044

41-
To install Comment Density Analyzer, run the following command in your terminal:
45+
Install **Comments Density Analyzer** as a development dependency via Composer:
4246

4347
```bash
4448
composer require --dev savinmikhail/comments-density
4549
```
4650

47-
### Usage
51+
---
52+
53+
## Usage
4854

49-
Analyze the comment density in your PHP files with:
55+
Analyze the comments in your PHP files:
5056

5157
```bash
5258
php vendor/bin/comments_density analyze
5359
```
5460

55-
Generate baseline with:
61+
Generate a baseline to ignore existing technical debt:
62+
5663
```bash
5764
php vendor/bin/comments_density baseline
5865
```
5966

60-
### Configuration
67+
---
68+
69+
## Configuration
6170

62-
On installation, you can allow plugin to create its configuration file.
63-
Customize your analysis by editing a comments_density.php configuration file:
71+
During installation, the tool can generate a default configuration file. Customize your analysis by editing the `comments_density.php` file:
6472

6573
```php
6674
<?php
@@ -82,20 +90,22 @@ return new Config(
8290
FixMeComment::NAME => 0,
8391
],
8492
);
85-
8693
```
8794

95+
---
96+
8897
## Acknowledgments
8998

90-
This project was inspired by Yegor Bugayenko. See [opensource ideas](https://gist.github.com/yegor256/5bddb12ce88a6cba44d578c567031508).
99+
This project was inspired by Yegor Bugayenko. See [Open Source Ideas](https://gist.github.com/yegor256/5bddb12ce88a6cba44d578c567031508).
100+
101+
---
91102

92103
## Contributing
93104

94-
Contributions are welcome! Please feel free to submit a Pull Request.
105+
Contributions are always welcome! Feel free to submit a pull request with improvements or new features.
95106

96-
## License
107+
---
97108

98-
This library is released under the [MIT license](LICENSE).
109+
## License
99110

100-
___
101-
111+
This library is licensed under the [MIT License](LICENSE).

0 commit comments

Comments
 (0)