Using badges in your Github repositories is a great visual way to attract people. Some badges are meaningful and productive to make use of, they boost the readability of your readme files.
Visitors of your repositories can capture the “important metrics that you decide” instantly. To help you decide about the important metrics, I gathered the top five badges to support your GitHub repositories’ trustworthiness with regards to being well tested and trusted.
By the time you integrate your project with Snyk, it automatically scans for vulnerabilities, fixes, and sends a pull request. Snyk’s GitHub badge shows the vulnerability state of the latest commit on the default branch.
Adding this badge to your repository gives a solid stance to your project. It can be counted as proof of security. More information about how to use it can be found here.
Code coverage is one of the essential parts of software quality in a CI pipeline. Tools like CodeCov enable developers to go to sleep with a mind in peace when their application is well tested all over.
Seeing that the code of a project is tested at a high percentage of coverage gives a reliable feeling to the contributors and users.
More importantly, it is important to increase the readability of your repository to give a quick glance at health metrics to expert or rookie developers.
Check out the documentation of status badges for more information.
LGTM badge in your repository will display the quality of the code of your project. It assigns a grade and a score to the code’s latest state but not the past versions.
- The code quality score, or score, is a measure of how impressed we are with a project. High values indicate projects with a code quality above expectation, and lower values indicate underperforming projects.
- The code quality grade, or grade, is an estimation of the relative quality of a project when compared to similar reference projects. It is a letter between A+ and E that puts the score in perspective.
LGTM displays alerts that indicate potential problems in your code. Alerts naturally indicate poor quality code when not taken into account.
You can find the instructions for adding badges to project README files in this document.
Showcasing Code Climate’s maintainability badge with an “A” rating in your GitHub repository reflects how issue-free your code is.
Code Climate calculates a rating between A to F with respect to the total remediation times of technical debt issues in a repository.
There are many advanced configuration options and settings which you can read from this document.
Thundra Foresight offers a number of badges to showcase your test metrics. It is always a good idea to be as confident as to show your software is tested well.
- The first badge is the Tests Badge;
This badge displays the results of your latest test run in your build. The results are displayed as the number of successful, failed, and skipped tests.
- The second badge is the Test Utilization Score Badge;
This badge strips your test performance from before-all, before-each, after-each, and after-all durations from the total test run duration, and calculates how your test code performs.
The utilization is calculated by using the following formula:
td = Total test run duration
ba = Total passed time while execution “before-all” phase
be = Total passed time while execution “before-each” phase
ae = Total passed time while execution “after-each” phase
aa = Total passed time while execution “after-all” phase
The low utilization factor indicates that most of the test run execution time is occupied by test-case or test-suite-based setup and/or teardown operations like starting or initializing a database or connection to an external service. For such a case, there might be possible optimization points in your tests by getting rid of redundant setup or teardown executions (for ex. initializing database for per test-suite instead of per test case)
- The third badge is the Successful Tests Badge;
It is nice to see a high percentage of successful tests on your repository. This badge can be so-called to impress and convince your contributors.
Here’s the documentation of how to generate dynamic test stats badges with Thundra Foresight.
Editor's edition: Foresight has a GitHub application that can be found on Github Marketplace.
Adding just a few lines of Markdown code to generate badges in your repositories helps your repository be more human-friendly in means of understandability.
Since the initial step of gaining trust from the first acquaintance, it’s a good idea to showcase that your GitHub repository is secure, well covered, maintained, tests are passing, and successful.