All Projects → bkoelman → Csharpguidelinesanalyzer

bkoelman / Csharpguidelinesanalyzer

Licence: apache-2.0
Reports diagnostics for C# coding guidelines that are not already covered by Resharper.

Labels

Projects that are alternatives of or similar to Csharpguidelinesanalyzer

Phan
Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
Stars: ✭ 5,194 (+6558.97%)
Mutual labels:  analyzer
Social Analyzer
API, CLI & Web App for analyzing & finding a person's profile across +1000 social media \ websites (Detections are updated regularly by automated systems)
Stars: ✭ 8,449 (+10732.05%)
Mutual labels:  analyzer
Python Netflow V9 Softflowd
PyPI "netflow" package. NetFlow v9 parser, collector and analyzer implemented in Python 3. Developed and tested with softflowd
Stars: ✭ 61 (-21.79%)
Mutual labels:  analyzer
Emba
emba - An analyzer for Linux-based firmware of embedded devices.
Stars: ✭ 607 (+678.21%)
Mutual labels:  analyzer
Pronto Fasterer
Pronto runner for Fasterer, speed improvements suggester
Stars: ✭ 18 (-76.92%)
Mutual labels:  analyzer
Um34c
A small NodeJS tool to read out and control the UM34C (or UM24C / UM25C) USB analyzer via Bluetooth
Stars: ✭ 36 (-53.85%)
Mutual labels:  analyzer
Python Seo Analyzer
An SEO tool that analyzes the structure of a site, crawls the site, count words in the body of the site and warns of any technical SEO issues.
Stars: ✭ 529 (+578.21%)
Mutual labels:  analyzer
Psscriptanalyzer
Download ScriptAnalyzer from PowerShellGallery
Stars: ✭ 1,137 (+1357.69%)
Mutual labels:  analyzer
Humorchecker
[Mirror] Port of Sentimental library into Go
Stars: ✭ 31 (-60.26%)
Mutual labels:  analyzer
Bpm Analyser
Analyser BPM in Swift for your music/sounds/records, whatever..
Stars: ✭ 60 (-23.08%)
Mutual labels:  analyzer
Phpsa
Smart/Static Analyzer(sis) for PHP
Stars: ✭ 651 (+734.62%)
Mutual labels:  analyzer
Sonar Java
☕️ SonarSource Static Analyzer for Java Code Quality and Security
Stars: ✭ 745 (+855.13%)
Mutual labels:  analyzer
Performance Bookmarklet
Performance-Bookmarklet helps to analyze the current page through the Resource Timing API, Navigation Timing API and User-Timing - requests by type, domain, load times, marks and more. Sort of a light live WebPageTest.
Stars: ✭ 997 (+1178.21%)
Mutual labels:  analyzer
Vs Threading
The Microsoft.VisualStudio.Threading is a xplat library that provides many threading and synchronization primitives used in Visual Studio and other applications.
Stars: ✭ 585 (+650%)
Mutual labels:  analyzer
Pronto Rubocop
Pronto runner for Rubocop, ruby code analyzer
Stars: ✭ 62 (-20.51%)
Mutual labels:  analyzer
Security Code Scan
Vulnerability Patterns Detector for C# and VB.NET
Stars: ✭ 550 (+605.13%)
Mutual labels:  analyzer
Sitrep
A source code analyzer for Swift projects.
Stars: ✭ 984 (+1161.54%)
Mutual labels:  analyzer
Rare
Fast, realtime regex-extraction, and aggregation into common formats such as histograms, numerical summaries, tables, and more!
Stars: ✭ 76 (-2.56%)
Mutual labels:  analyzer
Fountain Of Colors
Music visualizer for Rainmeter
Stars: ✭ 65 (-16.67%)
Mutual labels:  analyzer
Github View
Analyse activities and contributions of a GitHub user.
Stars: ✭ 54 (-30.77%)
Mutual labels:  analyzer

CSharp Guidelines Analyzer

Build status codecov

This Visual Studio analyzer supports you in making your code comply with the C# coding guidelines at CSharpGuidelines.

Note that many guidelines are already covered by Resharper, for which a layer file is provided. See Overview for the list of supported rules.

Analyzer in action

Get started

The latest version requires Visual Studio 2017 with Update 5 or higher. To get instant feedback on all files in your solution, activate Full Solution Analysis.

  • From the NuGet package manager console:

    Install-Package CSharpGuidelinesAnalyzer

    or, if you are using Visual Studio 2017 with Update 3:

    Install-Package CSharpGuidelinesAnalyzer -version 2.0.0

    or, if you are using Visual Studio 2015 with Update 2 or higher:

    Install-Package CSharpGuidelinesAnalyzer -version 1.0.1

  • Rebuild your solution

  • Optional: Reference CSharpGuidelines.Layer.DotSettings in your existing Resharper preferences

Rule configuration

The behavior of a few rules can optionally be customized using a configuration file. See documentation for details.

Suppressing rules

Rule warnings can be suppressed at various scopes, ranging from per line to at the project or solution level.

  • With #pragma lines, for example:
#pragma warning disable AV1532 // Loop statement contains nested loop
    foreach (string item in itemArray)
#pragma warning restore AV1532 // Loop statement contains nested loop

On the location of a warning, press Ctrl+. or Alt+Enter and select Suppress, in Source.

  • In GlobalSuppressions.cs, for example:
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Maintainability", "AV1532:Loop statement contains nested loop", Justification = "<Pending>", Scope = "member", Target = "~M:CSharpGuidelinesDemo.Demo.RunDemo(System.String[][],System.Boolean,System.String)~System.Collections.Generic.List{System.String}")]

On the location of a warning, press Ctrl+. or Alt+Enter and select Suppress, in Suppression File. Note that you can broaden the suppression scope by removing the Target and/or Scope attributes:

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Maintainability", "AV1532:Loop statement contains nested loop", Justification = "<Pending>")]
root = true

[*.cs]
dotnet_diagnostic.av1115.severity = error
dotnet_diagnostic.av1130.severity = suggestion
  • In a custom .ruleset file, which contains Code Analysis settings:

Right-click your project, select Properties, tab Code Analysis. Click Open, expand CSharpGuidelinesAnalyzers and uncheck the rules you want to disable. When you save changes, a .ruleset file is added to your project.

Alternatively, navigate to your project in Solution Explorer and expand References, Analyzers, CSharpGuidelinesAnalyzer. Then right-click on one of the rules and select Set Rule Set Severity. These changes are stored in a .ruleset file in your project.

To apply the custom ruleset to the entire solution, move the .ruleset file next to your .sln file and browse to it on the CodeAnalysis tab for each project.

Performance

If you run these analyzers on a large codebase and are concerned about performance, consider disabling AV1568 and AV1739. These two are by far the most resource-intensive.

Contribute!

The analyzers in this project benefit a lot from testing on various codebases. Some of the best ways to contribute are to try things out, file bugs, and join in design conversations.

Trying out the latest build

After each commit, a new prerelease NuGet package is automatically published to AppVeyor at https://ci.appveyor.com/project/bkoelman/csharpguidelinesanalyzer/branch/master/artifacts. To try it out, follow the next steps:

  • In Visual Studio: Tools, NuGet Package Manager, Package Manager Settings, Package Sources
  • Open the NuGet package manager console (Tools, NuGet Package Manager, Package Manager Console)
    • Select AppVeyor CSharpGuidelinesAnalyzer as package source
    • Run command: Install-Package CSharpGuidelinesAnalyzer -pre
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].