youssef1313 / yanalyzers Goto Github PK
View Code? Open in Web Editor NEWA set of analyzer rules implemented using .NET Compiler Platform (aka Roslyn) APIs
License: MIT License
A set of analyzer rules implemented using .NET Compiler Platform (aka Roslyn) APIs
License: MIT License
Maybe this is a known limitation? var myList = Array.Empty<string>().ToList();
will suggest to use an explicit type, but the fixer does nothing, I'd hoped for a suggested change to List<string> myList = Array.Empty<string>().ToList();
.
(Yes one can argue that the type really is apparent here, but that's not the point. I just wanted a simple one-liner to demonstrate that the fixer doesn't do what I hoped).
Whenever there is a class containing at least a method with [Fact]
or [Theory]
, ensure all other public methods having one of these attributes.
Analyze classes marked with [TestClass]
and look for any missing [TestMethod]
(or [DataSource]
) on a public method.
Analyze classes marked with [TestFixture]
and look for any missing [Test]
or [Theory]
.
For example, var sb = new StringBuilder('a');
, which can be misleading as it calls a constructor that accepts an int
.
Consider how should tuples be treated.
StackTrace:
System.NullReferenceException : Object reference not set to an instance of an object.
at Microsoft.CodeAnalysis.CSharp.Extensions.ITypeSymbolExtensions.GenerateTypeSyntax(INamespaceOrTypeSymbol symbol,Boolean nameSyntax,Boolean allowVar)
at Microsoft.CodeAnalysis.CSharp.CodeGeneration.CSharpSyntaxGenerator.TypeExpression(ITypeSymbol typeSymbol)
at async YAnalyzers.CSharp.UseImplicitOrExplicitTypeCodeFix.UseExplicitTypeAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetChangedSolutionAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.<>c__DisplayClass11_0.<GetPreviewAsync>b__0(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)
The form foreach (var (a, b) in x)
should be converted into foreach ((TypeA a, TypeB b) in x)
Also check if using it as a condition for VSIX can work instead of a solution filter.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.