Showing 7 of 278 total issues
Method ParseLine
has a Cognitive Complexity of 194 (exceeds 20 allowed). Consider refactoring. Open
Open
private static IEnumerable<IAsmLine> ParseLine(string fileLine, string fileName, int line)
{
var parsedLines = new List<IAsmLine>();
var comment = GetComment(fileLine);
- Read upRead up
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
Open
private static IEnumerable<IAsmLine> ParseLine(string fileLine, string fileName, int line)
{
var parsedLines = new List<IAsmLine>();
var comment = GetComment(fileLine);
File Parser.cs
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
Method GenerateCil
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void GenerateCil()
{
var aName = new AssemblyName("DynamicAssemblyExample");
var ab =
AssemblyBuilder.DefineDynamicAssembly(
Method OutputLine
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method GenerateCsharp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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]", "");
Method OutputLine
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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(':'));