https://github.com/kentico/codeanalysisruleset
Static code analysis rule set used in Kentico projects.
https://github.com/kentico/codeanalysisruleset
kentico kentico-cms kentico-ems
Last synced: about 1 year ago
JSON representation
Static code analysis rule set used in Kentico projects.
- Host: GitHub
- URL: https://github.com/kentico/codeanalysisruleset
- Owner: Kentico
- License: other
- Created: 2015-11-27T18:42:24.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-02-23T14:16:36.000Z (over 5 years ago)
- Last Synced: 2025-03-07T23:49:17.242Z (over 1 year ago)
- Topics: kentico, kentico-cms, kentico-ems
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 30
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: License.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Kentico Code Analysis Rule Set
[](https://ci.appveyor.com/project/kentico/codeanalysisruleset)
This repository contains a static code analysis rule set used by Kentico projects. The rule set aggregates various code analysis libraries and rules to one reusable NuGet package.
If you're new to static code analysis, take a look at this [video](https://www.youtube.com/watch?v=lFYyp_jUXgs).
:warning: This rule set is designed for Kentico v10. Using the rule set with a previous version of Kentico will produce some additional warnings.
### How do I install the rule set in my projects?
Install this NuGet package as a dependency. This automatically adds references to the code analyzer libraries and downloads the rule set file into the project root folder.
```powershell
Install-Package Kentico.CodeAnalysis.Ruleset
```
Then, in your project properties > code analysis > select the newly downloaded rule set.
### How do I run code analysis from the command line?
After a successful installation, set the ```RunCodeAnalysis``` parameter in ```MSBuild``` to true and you're good to go.
```powershell
MSBuild MySolution.sln /p:RunCodeAnalysis=true
```
### Benefits of distributing rule set as a NuGet package
- automatic updates of dependencies to Code Analyzer libraries
- automatic updates of the rule set file
- reusability of the same rule set in different projects/solutions
## Active rules
- **Microsoft.AnalyzerPowerPack.Common**
- :warning: [CA1715](https://msdn.microsoft.com/library/ms182243.aspx): Identifiers should have correct prefix.