archanox/RGBDS2CIL

View on GitHub

Showing 7 of 278 total issues

Method ParseLine has a Cognitive Complexity of 194 (exceeds 20 allowed). Consider refactoring.
Open

        private static IEnumerable<IAsmLine> ParseLine(string fileLine, string fileName, int line)
        {
            var parsedLines = new List<IAsmLine>();

            var comment = GetComment(fileLine);
Severity: Minor
Found in RGBDS2CIL/Parser.cs - About 3 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method ParseLine has 259 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        private static IEnumerable<IAsmLine> ParseLine(string fileLine, string fileName, int line)
        {
            var parsedLines = new List<IAsmLine>();

            var comment = GetComment(fileLine);
Severity: Major
Found in RGBDS2CIL/Parser.cs - About 1 day to fix

    File Parser.cs has 373 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections.Generic;
    using System.Collections.Immutable;
    using System.Diagnostics;
    using System.IO;
    Severity: Minor
    Found in RGBDS2CIL/Parser.cs - About 4 hrs to fix

      Method GenerateCil has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public static void GenerateCil()
              {
                  var aName = new AssemblyName("DynamicAssemblyExample");
                  var ab =
                      AssemblyBuilder.DefineDynamicAssembly(
      Severity: Major
      Found in RGBDS2CIL/CIL.cs - About 3 hrs to fix

        Method OutputLine has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public new void OutputLine(StringBuilder sb, int tabCount)
                {
                    //TODO: support for loops
                    //FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS
                    //FOR n, (NUM_TM_HM + 7) / 8
        Severity: Minor
        Found in RGBDS2CIL/Lines/RepeatLine.cs - About 1 hr to fix

          Method GenerateCsharp has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public static string GenerateCsharp(string fileName, List<IAsmLine> parsedLines, string root)
                  {
                      var sb = new StringBuilder();
          
                      var thisName = Regex.Replace(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Path.GetFileNameWithoutExtension(fileName)).Replace(" ", "").Replace('-', '_'), "[^A-Za-z0-9]", "");
          Severity: Minor
          Found in RGBDS2CIL/CSharp.cs - About 1 hr to fix

            Method OutputLine has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public new void OutputLine(StringBuilder sb, int tabCount)
                    {
                        //NOTE: Nested macros are prohibited
                        var privatePublic = IsLocal ? "private " : "public ";
                        var methodName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Name.Trim(':'));
            Severity: Minor
            Found in RGBDS2CIL/Lines/MacroLine.cs - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language