How important is code quality to your team? It should be at the top of the list, not only to make your customers happy but make your team happier when bugs arise and when features need to be added. Putting quality in your code in the future is a lot more expensive than doing it when the code is first written. How does your open-source solution compare to some of the most popular GitHub/ NuGet packages? Do you analyze repositories before using them or just adding them via NuGet? If not, you need to keep reading.
|
Foundatio
|
Code Quality Rating
|
|
https://github.com/FoundatioFx/Foundatio
|
15.42
|
Foundatio is a pluggable foundation blocks for building loosely coupled distributed apps which includes implementations in Redis, Azure, AWS, RabbitMQ, and in memory (for development). I have not used these projects, but it looks very interesting. The code quality rating shows there is a code violation every 15.42 lines of code, which is the best rating I have seen since starting these articles.
|
Errors
|
Warnings
|
Information
|
Unit Test Coverage
|
|
919
|
1,232
|
3,520
|
249 – Broken
|
|
Maintainability Index
|
Cyclomatic Complexity
|
Depth of Inheritance
|
Class Coupling
|
|
89
|
20,675
|
673
|
18,538
|
|
Lines of Source Code
|
Lines of Executable Code
|
Lines of Cloned Code
|
Code Commenting
|
|
87,429
|
37,212
|
717
|
Grade of D
|
Coding Standard Issues
Here are just some examples of what needs to be fixed from the 5,671 violations in this solution.
Using ConfigureAwait
All the 919 errors above were this issue: CA2007 - Consider calling ConfigureAwait on the awaited task. Here is an example of the code that violates this rule,
- await storage.SaveFileAsync(path, memoryStream);
This is fixed by adding ConfigureAwait() as recommended by Microsoft for DLL’s,
- await storage.SaveFileAsync(path, memoryStream).ConfigureAwait(continueOnCapturedContext: false);

Join the conversation! Your thoughts help the community grow.