cs-util-com/cscore

View on GitHub

Showing 1,140 of 1,140 total issues

Method UpdateMaterialProperties has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        void UpdateMaterialProperties() {

            // Apply properties according to mode
            outlineFillMaterial.SetColor("_OutlineColor", outlineColor);

    Method ObjectDiff has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            private JObject ObjectDiff(JObject left, JObject right)
            {
                if (left == null)
                    throw new ArgumentNullException(nameof(left));
                if (right == null)

      Method NewPage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public T NewPage<T>(BasePage prevPage = null)
                  where T : BasePage
              {
                  // get header
                  var header = this.GetPage<HeaderPage>(0);

        Method Diff has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public JToken Diff(JToken left, JToken right)
                {
                    if (left == null)
                        left = new JValue("");
                    if (right == null)

          Method stbi__out_gif_code has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private void stbi__out_gif_code(ushort code)
                  {
                      var idx = 0;
                      if (codes[code].prefix >= 0)
                          stbi__out_gif_code((ushort)codes[code].prefix);

            Method ProcessPrioritizedAndBatchedTasks has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    private void ProcessPrioritizedAndBatchedTasks() {
                        bool continueProcessing = true;
                        while (!_disposeCancellation.IsCancellationRequested && continueProcessing) {
                            try {
            
            

              Method RunCutOutAlgo has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public static byte[] RunCutOutAlgo(ImageResult imageRes, int colorThreshold, int trimapKernel, int guidedKernel, double eps, int cutoffValue) {
                          var image = imageRes.Data.DeepCopy();
                          var width = imageRes.Width;
                          var height = imageRes.Height;
                          var bytesPerPixel = (int)imageRes.ColorComponents;

                Method InternalUpdate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private void InternalUpdate(T updatedEntityData, UpdateType updateType) {
                            var entityId = updatedEntityData.Id;
                            var entity = (Entity)_entities[entityId];
                            entity.ThrowErrorIfDisposed();
                
                

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

                              var listenerInStore = store.AddStateChangeListener((_) => subState.GetState(), newSubState => {
                                  if (eventsAlwaysInMainThread) {
                                      MainThread.Invoke(() => { OnSubstateChangedForUnity(subState, newSubState, context); });
                                  } else {
                                      OnSubstateChangedForUnity(subState, newSubState, context);
                  CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/UiExtensionsForReduxStore.cs on lines 70..76

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

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

                          [Test]
                          public void TestOnValueChangedListeners() {
                              GameObject prefab = ResourcesV2.LoadPrefab("ExamplePrefab1.prefab");
                              Dictionary<string, Link> links = prefab.GetLinkMap();
                              {

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

                                var listenerInStore = store.AddStateChangeListener((_) => subState.GetState(), newSubState => {
                                    if (eventsAlwaysInMainThread) {
                                        MainThread.Invoke(() => { OnSubstateChangedForUnity(subState, newSubState, context); });
                                    } else {
                                        OnSubstateChangedForUnity(subState, newSubState, context);
                    CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/UiExtensionsForReduxStore.cs on lines 53..59

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

                    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

                            [Conditional("DEBUG"), Conditional("ENFORCE_ASSERTIONS")]
                            public static void AreNotEqual(double expected, double actual, string varName = "", params object[] args) {
                                var errorMsg = $"Assert.AreNotEqual() FAILED: expected number {varName}= {expected} IS equal to actual {varName}= {actual}";
                                Assert(!Equals(expected, actual), errorMsg, args);
                            }
                    CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/AssertV2.cs on lines 138..142

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

                    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 CalcEntryChangesToOldStateV2<E, K, V>(this E newState, ref E oldState, Action<KeyValuePair<K, V>> onEntryAdded, Action<KeyValuePair<K, V>, KeyValuePair<K, V>> onEntryUpdated, Action<K> onEntryRemoved) where E : IReadOnlyDictionary<K, V> {
                                CalcEntryChangesToOldState(newState, ref oldState, getKey: x => x.Key, onEntryAdded, onEntryUpdated, onEntryRemoved);
                            }
                    CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/model/immutable/IEnumerableDiffHelpers.cs on lines 24..26

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

                    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 CalcEntryChangesToOldState<E, K, V>(this E newState, ref E oldState, Action<KeyValuePair<K, V>> onEntryAdded, Action<KeyValuePair<K, V>, KeyValuePair<K, V>> onEntryUpdated, Action<K> onEntryRemoved) where E : IDictionary<K, V> {
                                CalcEntryChangesToOldState(newState, ref oldState, getKey: x => x.Key, onEntryAdded, onEntryUpdated, onEntryRemoved);
                            }
                    CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/model/immutable/IEnumerableDiffHelpers.cs on lines 15..17

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

                    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

                            [Conditional("DEBUG"), Conditional("ENFORCE_ASSERTIONS")]
                            public static void AreNotEqual(long expected, long actual, string varName = "", params object[] args) {
                                var errorMsg = $"Assert.AreNotEqual() FAILED: expected number {varName}= {expected} IS equal to actual {varName}= {actual}";
                                Assert(!Equals(expected, actual), errorMsg, args);
                            }
                    CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/AssertV2.cs on lines 132..136

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

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

                            private static void SetupForContentType(InputField self, JsonSchema field) {
                                if (EnumUtil.TryParse(field.format, out ContentFormat contentType)) {
                                    switch (contentType) {
                                        case ContentFormat.alphanumeric:
                                            self.contentType = InputField.ContentType.Alphanumeric;

                      Method UpdateContent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public override void UpdateContent(News item) {
                      
                                  if (newsListUi == null) { newsListUi = GetComponentInParent<NewsListUi>(); }
                      
                                  typeIndicator.color = newsListUi.GetColorFor(item);

                        Method diff_halfMatch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected string[] diff_halfMatch(string text1, string text2) {
                              if (this.Diff_Timeout <= 0) {
                                // Don't risk returning a non-optimal diff if we have unlimited time.
                                return null;
                              }

                          Method ReadContent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  protected override void ReadContent(ByteReader reader)
                                  {
                                      this.CollectionName = reader.ReadString();
                                      this.DocumentCount = reader.ReadInt64();
                                      this.FreeDataPageID = reader.ReadUInt32();

                            Method patch_addContext has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected void patch_addContext(Patch patch, string text) {
                                  if (text.Length == 0) {
                                    return;
                                  }
                                  string pattern = text.Substring(patch.start2, patch.length1);
                              Severity
                              Category
                              Status
                              Source
                              Language