cs-util-com/cscore

View on GitHub

Showing 1,140 of 1,140 total issues

Class UiExtensions has 27 methods (exceeds 20 allowed). Consider refactoring.
Open

    public static class UiExtensions {

        public static ViewStack GetViewStack(this GameObject gameObject) {
            var vs = gameObject.GetComponentInParents<ViewStack>();
            if (vs == null) { Log.e("Not part of a UI managed by a ViewStack", gameObject); }
Severity: Minor
Found in CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/UiExtensions.cs - About 3 hrs to fix

    Class Assert has 27 methods (exceeds 20 allowed). Consider refactoring.
    Open

        public static class Assert {
    
            public static void True(bool? b, string msg = null) {
                if (b is null) { throw new AssertException("Passed in boolean was null"); }
                if (!b.Value) { throw (msg != null) ? new AssertException(msg) : new AssertException(); }

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

              public void Write(Double value)
              {
                  var pi = BitConverter.GetBytes(value);
      
                  _buffer[_pos + 0] = pi[0];
      CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Utils/ByteWriter.cs on lines 94..108
      CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Utils/ByteWriter.cs on lines 132..146

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

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

              public void Write(Int64 value)
              {
                  var pi = BitConverter.GetBytes(value);
      
                  _buffer[_pos + 0] = pi[0];
      CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Utils/ByteWriter.cs on lines 94..108
      CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Utils/ByteWriter.cs on lines 160..174

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

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

              public void Write(UInt64 value)
              {
                  var pi = BitConverter.GetBytes(value);
      
                  _buffer[_pos + 0] = pi[0];
      CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Utils/ByteWriter.cs on lines 132..146
      CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Utils/ByteWriter.cs on lines 160..174

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

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

          public Object[] patch_apply(List<Patch> patches, string text) {
            if (patches.Count == 0) {
              return new Object[] { text, new bool[0] };
            }
      
      

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

                public static Task<Dropdown> WaitForDropDown(string targetId, Func<int, bool> isTextAccepted, object subscriber) {
                    var tcs = new TaskCompletionSource<Dropdown>();
                    var eventName = EventConsts.catUi + UiEvents.DROPDOWN_CHANGED;
                    EventBus.instance.Subscribe(subscriber, eventName, (Dropdown dropdown, int selection) => {
                        var isCorrectInput = dropdown.HasComponent<Link>(out var link) && link.id == targetId;
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/events/UiEvents.cs on lines 61..74

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

        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 Task<InputField> WaitForInputField(string targetId, Func<string, bool> isTextAccepted, object subscriber) {
                    var tcs = new TaskCompletionSource<InputField>();
                    var eventName = EventConsts.catUi + UiEvents.INPUTFIELD_CHANGED;
                    EventBus.instance.Subscribe(subscriber, eventName, (InputField input, string newText) => {
                        var isCorrectInput = input.HasComponent<Link>(out var link) && link.id == targetId;
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/events/UiEvents.cs on lines 80..93

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

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

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

          Method Format has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private List<FuseResult<T>> Format(List<AnalyzeResult> results)
                  {
                      var finalOutput = new List<FuseResult<T>>();
                      var transformers = new List<TransformResult>();
          
          

            File GuidedFilter.cs has 295 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            using System;
            using System.Collections.Generic;
            using System.Linq;
            
            namespace com.csutil.algorithms.images {

              File ExifTags.cs has 295 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              using System;
              
              namespace ExifLib
              {
                  /// <summary>

                Method ShaderPropertiesGUI has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        void ShaderPropertiesGUI(Material material)
                        {
                            // Use default labelWidth
                            EditorGUIUtility.labelWidth = 0f;
                
                

                  Consider simplifying this complex logical expression.
                  Open

                                  if ((_autoId == BsonAutoId.Int32 && (id.IsInt32 && id.AsInt32 == 0)) ||
                                      (_autoId == BsonAutoId.ObjectId && (id.IsNull || (id.IsObjectId && id.AsObjectId == ObjectId.Empty))) ||
                                      (_autoId == BsonAutoId.Guid && id.IsGuid && id.AsGuid == Guid.Empty) ||
                                      (_autoId == BsonAutoId.Int64 && id.IsInt64 && id.AsInt64 == 0))
                                  {

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

                            public BsonValue Min(string collection, string field)
                            {
                                if (collection.IsNullOrWhiteSpace()) throw new ArgumentNullException(nameof(collection));
                                if (field.IsNullOrWhiteSpace()) throw new ArgumentNullException(nameof(field));
                    
                    
                    CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Engine/Engine/Aggregate.cs on lines 37..58

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

                    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 BsonValue Max(string collection, string field)
                            {
                                if (collection.IsNullOrWhiteSpace()) throw new ArgumentNullException(nameof(collection));
                                if (field.IsNullOrWhiteSpace()) throw new ArgumentNullException(nameof(field));
                    
                    
                    CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Engine/Engine/Aggregate.cs on lines 11..32

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

                    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

                                    Vector3 omega = (Vector3.Cross(_quatBasis[0], A[0]) +
                                        Vector3.Cross(_quatBasis[1], A[1]) +
                                        Vector3.Cross(_quatBasis[2], A[2])) *
                                        (1f / Math.Abs(Vector3.Dot(_quatBasis[0], A[0]) +
                                            Vector3.Dot(_quatBasis[1], A[1]) +
                    CsCore/UnityTests/Assets/Plugins/CsCoreUnityTests/math/KabschAlgorithmTests.cs on lines 89..94

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

                    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

                                        Vector3 omega = (Vector3.Cross(QuatBasis[0], A[0]) +
                                            Vector3.Cross(QuatBasis[1], A[1]) +
                                            Vector3.Cross(QuatBasis[2], A[2])) *
                                            (1f / Mathf.Abs(Vector3.Dot(QuatBasis[0], A[0]) +
                                                Vector3.Dot(QuatBasis[1], A[1]) +
                    CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/algorithms/KabschAlgorithm.cs on lines 93..98

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

                    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

                    File JsonModelExtensions.cs has 288 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    using com.csutil.model.jsonschema;
                    using Newtonsoft.Json.Linq;
                    using System;
                    using System.Collections.Generic;
                    using System.Diagnostics;

                      File Bitap.cs has 287 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      using System;
                      using System.Collections.Generic;
                      using System.Text.RegularExpressions;
                      
                      namespace Fuse.NET
                        Severity
                        Category
                        Status
                        Source
                        Language