rjmurillo/moq.analyzers

View on GitHub

Showing 487 of 513 total issues

Method CreateDiagnostic has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    this IOperation operation,
    DiagnosticDescriptor rule,
    ImmutableDictionary<string, string?>? properties,
    params object?[]? messageArgs) => operation.CreateDiagnostic(rule, additionalLocations: null, properties, messageArgs);
Severity: Minor
Found in src/Common/DiagnosticExtensions.cs - About 35 mins to fix

    Method CreateDiagnostic has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            this Location location,
            DiagnosticDescriptor rule,
            ImmutableDictionary<string, string?>? properties,
            params object?[]? messageArgs) => location.CreateDiagnostic(rule, additionalLocations: null, properties, messageArgs);
    Severity: Minor
    Found in src/Common/DiagnosticExtensions.cs - About 35 mins to fix

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public static Diagnostic CreateDiagnostic(
          this IOperation operation,
          DiagnosticDescriptor rule,
          ImmutableDictionary<string, string?>? properties,
          params object?[]? messageArgs) => operation.CreateDiagnostic(rule, additionalLocations: null, properties, messageArgs);
      Severity: Minor
      Found in src/Common/DiagnosticExtensions.cs and 2 other locations - About 30 mins to fix
      src/Common/DiagnosticExtensions.cs on lines 12..16
      src/Common/DiagnosticExtensions.cs on lines 36..40

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 61.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public static Diagnostic CreateDiagnostic(
              this SyntaxNode node,
              DiagnosticDescriptor rule,
              ImmutableDictionary<string, string?>? properties,
              params object?[]? messageArgs) => node.CreateDiagnostic(rule, additionalLocations: null, properties, messageArgs);
      Severity: Minor
      Found in src/Common/DiagnosticExtensions.cs and 2 other locations - About 30 mins to fix
      src/Common/DiagnosticExtensions.cs on lines 36..40
      src/Common/DiagnosticExtensions.cs on lines 63..67

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 61.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public static Diagnostic CreateDiagnostic(
              this Location location,
              DiagnosticDescriptor rule,
              ImmutableDictionary<string, string?>? properties,
              params object?[]? messageArgs) => location.CreateDiagnostic(rule, additionalLocations: null, properties, messageArgs);
      Severity: Minor
      Found in src/Common/DiagnosticExtensions.cs and 2 other locations - About 30 mins to fix
      src/Common/DiagnosticExtensions.cs on lines 12..16
      src/Common/DiagnosticExtensions.cs on lines 63..67

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 61.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Avoid too many return statements within this method.
      Open

                          return;
      Severity: Major
      Found in src/Analyzers/SetupShouldBeUsedOnlyForOverridableMembersAnalyzer.cs - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return;
        Severity: Major
        Found in src/Analyzers/SetupShouldBeUsedOnlyForOverridableMembersAnalyzer.cs - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  if (mockedMethodInvocation == null) return;
          Severity: Major
          Found in src/Analyzers/CallbackSignatureShouldMatchMockedMethodAnalyzer.cs - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                return;
            Severity: Major
            Found in src/Analyzers/SetupShouldBeUsedOnlyForOverridableMembersAnalyzer.cs - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                  return;
              Severity: Major
              Found in src/Analyzers/SetupShouldBeUsedOnlyForOverridableMembersAnalyzer.cs - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                StringComparison.Ordinal)) return;
                Severity: Major
                Found in src/Analyzers/NoSealedClassMocksAnalyzer.cs - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return document.WithSyntaxRoot(newRoot);
                  Severity: Major
                  Found in src/CodeFixes/CallbackSignatureShouldMatchMockedMethodCodeFix.cs - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            if (typeArguments.Count != 1) return;
                    Severity: Major
                    Found in src/Analyzers/NoSealedClassMocksAnalyzer.cs - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              if (symbolInfo.Symbol is not INamedTypeSymbol symbol) return;
                      Severity: Major
                      Found in src/Analyzers/NoSealedClassMocksAnalyzer.cs - About 30 mins to fix

                        Multiple headers with the same content
                        Open

                        ### New Rules

                        MD024 - Multiple headers with the same content

                        Tags: headers

                        Aliases: no-duplicate-header

                        Parameters: allowdifferentnesting (boolean; default false)

                        This rule is triggered if there are multiple headers in the document that have the same text:

                        # Some text
                        
                        ## Some text

                        To fix this, ensure that the content of each header is different:

                        # Some text
                        
                        ## Some more text

                        Rationale: Some markdown parses generate anchors for headers based on the header name, and having headers with the same content can cause problems with this.

                        If the parameter allow_different_nesting is set to true, header duplication under different nesting is allowed, like it usually happens in change logs:

                        # Change log
                        
                        ## 2.0.0
                        
                        ### Bug fixes
                        
                        ### Features
                        
                        ## 1.0.0
                        
                        ### Bug fixes

                        Multiple headers with the same content
                        Open

                        ### New Rules

                        MD024 - Multiple headers with the same content

                        Tags: headers

                        Aliases: no-duplicate-header

                        Parameters: allowdifferentnesting (boolean; default false)

                        This rule is triggered if there are multiple headers in the document that have the same text:

                        # Some text
                        
                        ## Some text

                        To fix this, ensure that the content of each header is different:

                        # Some text
                        
                        ## Some more text

                        Rationale: Some markdown parses generate anchors for headers based on the header name, and having headers with the same content can cause problems with this.

                        If the parameter allow_different_nesting is set to true, header duplication under different nesting is allowed, like it usually happens in change logs:

                        # Change log
                        
                        ## 2.0.0
                        
                        ### Bug fixes
                        
                        ### Features
                        
                        ## 1.0.0
                        
                        ### Bug fixes

                        Line length
                        Open

                        [Moq](https://github.com/devlooped/moq) framework. Moq.Analyzers protects you from common mistakes and warns you if
                        Severity: Info
                        Found in README.md by markdownlint

                        MD013 - Line length

                        Tags: line_length

                        Aliases: line-length

                        Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

                        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

                        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

                        You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

                        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

                        Multiple headers with the same content
                        Open

                        ### New Rules

                        MD024 - Multiple headers with the same content

                        Tags: headers

                        Aliases: no-duplicate-header

                        Parameters: allowdifferentnesting (boolean; default false)

                        This rule is triggered if there are multiple headers in the document that have the same text:

                        # Some text
                        
                        ## Some text

                        To fix this, ensure that the content of each header is different:

                        # Some text
                        
                        ## Some more text

                        Rationale: Some markdown parses generate anchors for headers based on the header name, and having headers with the same content can cause problems with this.

                        If the parameter allow_different_nesting is set to true, header duplication under different nesting is allowed, like it usually happens in change logs:

                        # Change log
                        
                        ## 2.0.0
                        
                        ### Bug fixes
                        
                        ### Features
                        
                        ## 1.0.0
                        
                        ### Bug fixes

                        Line length
                        Open

                        | [Moq1000](./Moq1000.md) | Sealed classes cannot be mocked                                                         |
                        Severity: Info
                        Found in docs/rules/README.md by markdownlint

                        MD013 - Line length

                        Tags: line_length

                        Aliases: line-length

                        Parameters: linelength, ignorecodeblocks, codeblocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)

                        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

                        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

                        You also have the option to exclude this rule for code blocks. To do this, set the ignore_code_blocks parameter to true. To exclude this rule for tables set the tables parameters to false. Setting the parameter code_blocks to false to exclude the rule for code blocks is deprecated and will be removed in a future release.

                        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

                        First header should be a top level header
                        Open

                        ## Release 0.0.1.22865

                        MD002 - First header should be a top level header

                        Tags: headers

                        Aliases: first-header-h1

                        Parameters: level (number; default 1)

                        This rule is triggered when the first header in the document isn't a h1 header:

                        ## This isn't a H1 header
                        
                        ### Another header

                        The first header in the document should be a h1 header:

                        # Start with a H1 header
                        
                        ## Then use a H2 for subsections
                        Severity
                        Category
                        Status
                        Source
                        Language