cs-util-com/cscore

View on GitHub

Showing 1,140 of 1,140 total issues

Method SetupUsing has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public static UsageRule SetupUsing(this UsageRule self, ILocalAnalytics analytics) {
            self.isTrue = async () => {
                switch (self.ruleType) {

                    case UsageRule.AppUsedXDays: return await self.IsAppUsedXDays(analytics);

    Method LogMethodDone has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public virtual void LogMethodDone(Stopwatch timing, object[] args, int maxAllowedTimeInMs, string sourceMemberName, string sourceFilePath, int sourceLineNumber) {
                var timingV2 = timing as StopwatchV2;
                string methodName = sourceMemberName;
                if (timingV2 != null) {
                    timingV2.StopV2();

      Method TestPlayerPrefsFromBackgroundThreadTasks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              private async Task TestPlayerPrefsFromBackgroundThreadTasks() {
                  var myKey1 = "myKey1";
                  var myVal1 = "myVal1";
                  var myFallback1 = "myFallback1";
      
      

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

                public class Response {
        
                    public string id { get; set; }
                    public string @object { get; set; }
                    public int created { get; set; }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/http/apis/OpenAi.cs on lines 367..388

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

        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

                public class Response {
        
                    public string id { get; set; }
                    public string @object { get; set; }
                    public int created { get; set; }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/http/apis/OpenAi.cs on lines 291..312

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

        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

                            case Positions.OuterBottom:
                                topLeft.x = pixelRect.xMin;
                                topLeft.y = pixelRect.yMin;
        
                                ShapeUtils.Rects.AddVerticalTwoColorRect(
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/Components/UiShapes/EdgeGradient.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 93.

        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) {
                    Assert(!Equals(expected, actual), () => $"Assert.AreNotEqual() FAILED: expected number {varName}= {expected} IS equal to actual {varName}= {actual}", args);
                }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/AssertV3.cs on lines 132..135

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

        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

                            case Positions.Top:
                                topLeft.x = pixelRect.xMin;
                                topLeft.y = pixelRect.yMax;
        
                                ShapeUtils.Rects.AddVerticalTwoColorRect(
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/Components/UiShapes/EdgeGradient.cs on lines 136..149

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

        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

                    {
                        await Dialog.ShowInfoDialog("Generating UIs from JSON schemas",
                            "This time the json schema is loaded from an JSON schema string", "Show example");
                        var schemaGenerator = new ModelToJsonSchema();
                        JsonSchema schema = JsonReader.GetReader().Read<JsonSchema>(SomeJsonSchemaExamples.jsonSchema1);
        CsCore/UnityTests/Assets/Plugins/CsCoreUnityDemoScenes/Ui18_JsonSchemaUiGenerator/Ui18_1_JsonSchemaUiGenerator.cs on lines 38..44

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

        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

                            case Positions.OuterRight:
                                topLeft.x = pixelRect.xMax;
                                topLeft.y = pixelRect.yMax;
        
                                ShapeUtils.Rects.AddHorizontalTwoColorRect(
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/Components/UiShapes/EdgeGradient.cs on lines 91..104

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

        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

                    {
                        await Dialog.ShowInfoDialog("Editing arrays & lists:",
                            "Both primitave lists but also List<MyClass1> can be shown and edited", "Show list example");
                        var schemaGenerator = new ModelToJsonSchema();
                        JsonSchema schema = JsonReader.GetReader().Read<JsonSchema>(SomeJsonSchemaExamples.jsonSchema2);
        CsCore/UnityTests/Assets/Plugins/CsCoreUnityDemoScenes/Ui18_JsonSchemaUiGenerator/Ui18_1_JsonSchemaUiGenerator.cs on lines 31..37

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

        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) {
                    Assert(!Equals(expected, actual), () => $"Assert.AreNotEqual() FAILED: expected number {varName}= {expected} IS equal to actual {varName}= {actual}", args);
                }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/AssertV3.cs on lines 127..130

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

        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

                            case Positions.Left:
                                topLeft.x = pixelRect.xMin;
                                topLeft.y = pixelRect.yMax;
        
                                ShapeUtils.Rects.AddHorizontalTwoColorRect(
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/Components/UiShapes/EdgeGradient.cs on lines 166..179

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

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

                    public virtual GameObject CreateListEntryUi(ActionMenu menu, bool showOnlyFavs, TaskCompletionSource<Entry> taskComplSource) {
                        var entry = this;
                        var listEntryUiGo = ResourcesV2.LoadPrefab(entry.listModeEntryPrefabName);
                        var map = listEntryUiGo.GetLinkMap();
                        map.Get<Text>("Icon").text = entry.icon;

          Method WithFormContent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public RestRequest WithFormContent(Dictionary<string, object> formData) {
                      if (form == null) { form = new WWWForm(); }
                      foreach (var formEntry in formData) {
                          string key = formEntry.Key;
                          object v = formEntry.Value;

            Method SetupForViewMode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        private void SetupForViewMode(ActionMenu menu) {
                            map.Get<Button>("ToggleBetweenViewModes").SetOnClickAction(delegate {
                                menu.viewMode = GetNextViewMode(menu);
                                SetupForViewMode(menu);
                                menu.persistedSettings.Set(menu.menuId + " viewMode", menu.viewMode);

              Method GetResult has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public static T GetResult<T>(this UnityWebRequest self, IJsonReader r) {
                          AssertV3.IsTrue(self.isDone, () => "web request was not done!");
                          if (TypeCheck.AreEqual<T, UnityWebRequest>()) { return (T)(object)self; }
                          if (typeof(Texture2D).IsCastableTo(typeof(T))) {
                              AssertV3.IsTrue(self.downloadHandler is DownloadHandlerTexture,

                Method Awake has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        protected override void Awake() {
                            base.Awake();
                            rectTransform = GetComponent<RectTransform>();
                            scrollRect = GetComponent<ScrollRect>();
                
                

                  Method RecoveryCollectionPages has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          private static Dictionary<uint, string> RecoveryCollectionPages(UltraLiteEngine engine, HeaderPage header, StringBuilder log)
                          {
                              var result = new Dictionary<uint, string>();
                  
                              // get collection page

                    Method WriteContent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            protected override void WriteContent(ByteWriter writer)
                            {
                                writer.Write(this.CollectionName);
                                writer.Write(this.DocumentCount);
                                writer.Write(this.FreeDataPageID);
                      Severity
                      Category
                      Status
                      Source
                      Language