cs-util-com/cscore

View on GitHub

Showing 1,140 of 1,140 total issues

Method stbi__parse_png_file has a Cognitive Complexity of 289 (exceeds 20 allowed). Consider refactoring.
Open

        private int stbi__parse_png_file(int scan, int req_comp)
        {
            var palette = new byte[1024];
            var pal_img_n = (byte)0;
            var has_trans = (byte)0;

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

File JpgDecoder.cs has 1543 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.IO;
using System.Runtime.InteropServices;
using StbImageSharp.Utility;

    File DiffMatchPatch.cs has 1525 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Text;

      Method stbi__create_png_image_raw has a Cognitive Complexity of 184 (exceeds 20 allowed). Consider refactoring.
      Open

              private int stbi__create_png_image_raw(FakePtr<byte> raw, uint raw_len, int out_n, uint x, uint y, int depth,
                  int color)
              {
                  var bytes = depth == 16 ? 2 : 1;
                  uint i = 0;

      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 load_jpeg_image has a Cognitive Complexity of 167 (exceeds 20 allowed). Consider refactoring.
      Open

              private byte[] load_jpeg_image(out int out_x, out int out_y, out int comp, int req_comp)
              {
                  out_x = out_y = comp = 0;
      
                  var n = 0;

      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

      File Markdown.cs has 1088 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using System;
      using System.Collections.Generic;
      using System.Text;
      using System.Text.RegularExpressions;
      
      

        Method stbi__parse_entropy_coded_data has a Cognitive Complexity of 146 (exceeds 20 allowed). Consider refactoring.
        Open

                private int stbi__parse_entropy_coded_data()
                {
                    stbi__jpeg_reset();
                    if (progressive == 0)
                    {

        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

        File TextFieldParser.cs has 982 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using System;
        using System.Globalization;
        using System.IO;
        using System.Text;
        using System.Text.RegularExpressions;

          Method stbi__jpeg_decode_block_prog_ac has a Cognitive Complexity of 128 (exceeds 20 allowed). Consider refactoring.
          Open

                  private int stbi__jpeg_decode_block_prog_ac(FakePtr<short> data, stbi__huffman hac, short[] fac)
                  {
                      var k = 0;
                      if (spec_start == 0)
                          stbi__err("can't merge dc and ac");

          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 InternalDecode has a Cognitive Complexity of 124 (exceeds 20 allowed). Consider refactoring.
          Open

                  private ImageResult InternalDecode(ColorComponents? requiredComponents)
                  {
                      byte[] _out_;
                      var mr = (uint)0;
                      var mg = (uint)0;

          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

          File PngDecoder.cs has 823 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          using System;
          using System.IO;
          using System.Runtime.InteropServices;
          using StbImageSharp.Utility;
          
          

            Method stbi__gif_load_next has a Cognitive Complexity of 107 (exceeds 20 allowed). Consider refactoring.
            Open

                    private byte[] stbi__gif_load_next(out int comp, FakePtr<byte>? two_back)
                    {
                        comp = 0;
            
                        var dispose = 0;

            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 diff_bisect has a Cognitive Complexity of 84 (exceeds 20 allowed). Consider refactoring.
            Open

                protected List<Diff> diff_bisect(string text1, string text2,
                    DateTime deadline) {
                  // Cache the text lengths to prevent multiple calls.
                  int text1_length = text1.Length;
                  int text2_length = text2.Length;

            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 stbi__create_png_image_raw has 270 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    private int stbi__create_png_image_raw(FakePtr<byte> raw, uint raw_len, int out_n, uint x, uint y, int depth,
                        int color)
                    {
                        var bytes = depth == 16 ? 2 : 1;
                        uint i = 0;

              Method stbi__process_marker has a Cognitive Complexity of 81 (exceeds 20 allowed). Consider refactoring.
              Open

                      private int stbi__process_marker(int m)
                      {
                          var L = 0;
                          switch (m)
                          {

              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

              File ExifReader.cs has 593 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              using System;
              using System.Collections.Generic;
              using System.Globalization;
              using System.IO;
              using System.Reflection;

                Method InternalDecode has a Cognitive Complexity of 78 (exceeds 20 allowed). Consider refactoring.
                Open

                        private ImageResult InternalDecode(ColorComponents? requiredComponents)
                        {
                            var tga_offset = (int)stbi__get8();
                            var tga_indexed = (int)stbi__get8();
                            var tga_image_type = (int)stbi__get8();

                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 stbi__parse_png_file has 235 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private int stbi__parse_png_file(int scan, int req_comp)
                        {
                            var palette = new byte[1024];
                            var pal_img_n = (byte)0;
                            var has_trans = (byte)0;

                  Method InternalDecode has 221 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          private ImageResult InternalDecode(ColorComponents? requiredComponents)
                          {
                              byte[] _out_;
                              var mr = (uint)0;
                              var mg = (uint)0;

                    Class Markdown has 61 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                        public class Markdown
                        {
                            private const string _version = "1.13";
                    
                            #region Constructors and Options
                      Severity
                      Category
                      Status
                      Source
                      Language