cs-util-com/cscore

View on GitHub

Showing 1,140 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);

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                      module.exports = function(filename, projectPath, folderPath) {
                          var namespace = "Unknown";
                          if (projectPath) {
                              namespace = path.basename(projectPath, path.extname(projectPath));
                              if (folderPath) {
                      Severity: Major
                      Found in CsCore/.vscode/solution-explorer/template-parameters.js and 1 other location - About 5 hrs to fix
                      TemplateSolution/.vscode/solution-explorer/template-parameters.js on lines 3..16

                      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 140.

                      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

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                      module.exports = function(filename, projectPath, folderPath) {
                          var namespace = "Unknown";
                          if (projectPath) {
                              namespace = path.basename(projectPath, path.extname(projectPath));
                              if (folderPath) {
                      CsCore/.vscode/solution-explorer/template-parameters.js on lines 3..16

                      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 140.

                      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

                      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)
                                      {

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

                                    public static void AddHorizontalTwoColorRect(
                                        ref VertexHelper vh,
                                        Vector3 topLeft,
                                        float height,
                                        float width,
                            CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/Components/UiShapes/Rects.cs on lines 221..239

                            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 326.

                            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 2 locations. Consider refactoring.
                            Open

                                    public static void AddVerticalTwoColorRect(
                                        ref VertexHelper vh,
                                        Vector3 topLeft,
                                        float height,
                                        float width,
                            CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/Components/UiShapes/Rects.cs on lines 241..260

                            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 326.

                            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

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language