Azure DevOps - Static Code Analysis

Static Code Analysis The Code Analysis feature of Visual Studio performs a static code analysis to help developers identify potential design...

Static Code Analysis

The Code Analysis feature of Visual Studio performs a static code analysis to help developers identify potential design, globalization, interoperability, performance, security, and a host of other categories of potential problems. Code Analysis can be run manually at any time from within the Visual Studio IDE, or even set up to automatically run as part of a Team Build or check-in policy for Azure DevOps Server.

Below are the steps to Add static code Analysis to your Azure Pipeline using Visual studio

  • Open Visual Studio and Create an Aspnet core project (sample project).
  • In Tools--->NuGetPackage Manager-->Manage NuGet Packages for Solution.
  • In the Browse tab search for FxCop and from the list select Microsoft.CodeAnalysis.FxCopAnalyzer
  • On the right-hand side, the Window, select your project name and Install it.
  • Build your solution Build--->Build Solution
  • Now select View--->Error list
  • In the Dependencies tab in solution Explorer select Microsoft.CodeAnalysis tool and check the Diagnostic Properties which shows the default severity value.
  • In the Messages tab, you will find some warnings related to the code analysis.
  • Create an Azure Repo (say StaticCodeAnalysis) in Azure DevOps.
  • Add the HTTPS URL of this repo in the project git repository's remote reference (Git-->Manage Remotes..) in your solution.
  • Create an Azure pipeline and select Azure Repo(StaticCodeAnalysis) and AspNetCore platform and Run the pipeline.



Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,Jira,1,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
DevOpsWorld: Azure DevOps - Static Code Analysis
Azure DevOps - Static Code Analysis
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content