VSCodeGeneration ToolResharperProvides continuous support for C #, VB. NET, XAML, XML, ASP. NET, ASP. net mvc, JavaScript, HTML, and CSS.Code Quality AnalysisAnd the user detects errors and problems before compiling. This article describes how to implement code quality analysis using the vs code generation tool resharper.
Continuous code Quality Analysis
Resharper provides over 1300 code inspections for user code. Users can immediately check whether errors and faults are included in their current file or the entire solution.
Resharper will highlight the errors and faults detected on the right side of vs code editor, and visually check the errors and faults through the marker bar on the right side of the editor window.
If the file contains errors or faults, the status indicator at the top of the marker bar changes its color and icon.
Detect errors and code taste
- Errors
Resharper can check the code immediately and highlight code errors in the editor. The error code is highlighted in red or broken lines. If you hover the mouse pointer over the error code, the description is displayed in the tooltip.
- Warnings
In addition to compiler errors and warnings, resharper also displays warnings that do not prevent code editing, but may cause low encoding efficiency. For example, resharper prompts incorrectly formatted strings and redundant conversions, but does not prompt unused local variables. Structures with related warnings are highlighted with gray text or blue broken-wave underscores.
- Suggestions
You can use Code Recommendations for deeper code analysis. The code recommendations provide a deep understanding of the code structure. We recommend that you highlight it with green, wavy underline.
Quick Fix
Resharper provides quick fixes for most errors and highlighted projects, helping you solve problems quickly. The red light code quickly fixes errors. The yellow light represents warnings, suggestions, and prompts. Click the light bulb or Alt + enter to view the error quick fix list. Select the corresponding quick fix in the list to solve the problem in the fastest and most convenient way.
Test custom code
Resharper 5 provides structure search and replacement to locate custom code structures and replace them with other code structures.
Search for code Problems
Resharper 5 and later allows you to view all the code highlights of resharper from inspection results: code quality problems, code redundancy, and code improvement suggestions. This is much easier than searching and deleting code files one by one.
In the resharper menu, select inspect | code issues in solution or inspect | code issues in current project to display the tool window inspection results. In addition, you can select a node in Solution Explorer, right-click the node, and select find code issues, as shown in: