cs-util-com/cscore

View on GitHub

Showing 736 of 1,140 total issues

Method InternalDecode has 150 lines of code (exceeds 25 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();

    File ZLib.cs has 415 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using StbImageSharp.Utility;
    
    namespace StbImageSharp.Decoding
    {

      File GifDecoder.cs has 412 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 146 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Class diff_match_patch has 43 methods (exceeds 20 allowed). Consider refactoring.
          Open

            public class diff_match_patch {
              // Defaults.
              // Set these on your diff_match_patch instance to override the defaults.
          
              // Number of seconds to map a diff before giving up (0 for infinity).

            Method stbi__jpeg_decode_block_prog_ac has 142 lines of code (exceeds 25 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");

              Method stbi__parse_entropy_coded_data has 141 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Method stbi__parse_huffman_block has a Cognitive Complexity of 52 (exceeds 20 allowed). Consider refactoring.
                Open

                        private int stbi__parse_huffman_block()
                        {
                            var zout = this.zout;
                            for (; ; )
                            {

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

                        private bool GetTagValue<T>(Dictionary<ushort, long> tagDictionary, ushort tagID, out T result)
                        {
                            ushort tiffDataType;
                            uint numberOfComponents;
                            byte[] tagData = GetTagBytes(tagDictionary, tagID, out tiffDataType, out numberOfComponents);

                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 GlobalMatting.cs has 398 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                using System;
                using System.Collections.Generic;
                using System.Linq;
                using StbImageSharp;
                
                

                  File OpenAi.cs has 395 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  using System;
                  using System.Collections.Generic;
                  using System.Diagnostics;
                  using System.Net;
                  using System.Threading.Tasks;

                    Method stbi__idct_block has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            private static void stbi__idct_block(FakePtr<byte> _out_, int out_stride, FakePtr<short> data)
                            {
                                var i = 0;
                                var val = new int[64];
                                var v = new FakePtr<int>(val);

                      Method AddRoundedRectLine has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public static void AddRoundedRectLine(
                                  ref VertexHelper vh,
                                  Vector2 center,
                                  float width,
                                  float height,

                        Method GetBitapSearch has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                private BitapResult GetBitapSearch(string text)
                                {
                                    var expectedLocation = _options.location;
                                    var textLen = text.Length;
                                    var currentThreshold = _options.threshold;

                          Method stbi__process_marker has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Method diff_cleanupEfficiency has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring.
                            Open

                                public void diff_cleanupEfficiency(List<Diff> diffs) {
                                  bool changes = false;
                                  // Stack of indices where equalities are found.
                                  Stack<int> equalities = new Stack<int>();
                                  // Always equal to equalities[equalitiesLength-1][1]

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

                                    private string[] ParseDelimitedLine()
                                    {
                                        string Line = ReadNextDataLine();
                                        if (Line == null)
                                            return null;

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

                                    private ImageResult InternalDecode(ColorComponents? requiredComponents, int bpc)
                                    {
                                        var pixelCount = 0;
                                        var channelCount = 0;
                                        var compression = 0;

                              Class JpgDecoder has 37 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                  public
                              #else
                                  internal
                              #endif
                                  class JpgDecoder : Decoder

                                Class IEnumerableExtensions has 37 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                    public static class IEnumerableExtensions {
                                
                                        public static IEnumerable<R> Map<T, R>(this IEnumerable<T> self, Func<T, R> selector) {
                                            return self.Select(selector);
                                        }
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language