cs-util-com/cscore

View on GitHub

Showing 1,140 of 1,140 total issues

Method CalcButterworthAvg has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public static double[] CalcButterworthAvg(this double[] self, double dtInSec, double CutOff) {
            if (self == null) { return null; }
            if (CutOff == 0) { return self; }

            double Samplingrate = 1 / dtInSec;

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

                    button.SetOnClickAction(btnGo => {
                        if (menu.entries.Contains(entry)) {
                            menu.clickedEntry = entry;
                            EventBus.instance.Publish(EventConsts.catUi + UiEvents.ACTION_MENU, menu.GetFullEntryId(entry));
                            taskComplSource.TrySetResult(entry);
    CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/Components/ActionMenu.cs on lines 177..184

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

    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

                    button.SetOnClickAction(go => {
                        if (menu.entries.Contains(entry)) {
                            menu.clickedEntry = entry;
                            EventBus.instance.Publish(EventConsts.catUi + UiEvents.ACTION_MENU, menu.GetFullEntryId(entry));
                            taskComplSource.TrySetResult(entry);
    CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/Components/ActionMenu.cs on lines 154..161

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

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

            private void DrawEditorLayoutUi(GUILayoutOption[] o) {
                switch (propertyType) {
                    case SerializedPropertyType.Integer:
                        SetValue(EditorGUILayout.IntField(GetLabelForProp(), (int)GetValue(), o));
                        break;

      Method LoadAndPersistTo has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public static async Task<Texture2D> LoadAndPersistTo(IFileRef imgRef, DirectoryEntry targetDir, int thumbnailPixelWidth, Action<Texture2D> showTexture) {
                  Texture2D tempThumbTexture = null;
                  var hasAlpha = imgRef.mimeType == "image/png";
                  if (imgRef.fileName != null) { // Try load local thumbnail as quick as possible:
                      var i = targetDir.GetChild(imgRef.fileName);

        Method Info has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public BsonDocument Info()
                {
                    var header = _pager.GetPage<HeaderPage>(0);
                    var collections = new BsonArray();
        
        

          Method TryObtainLockAsync has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      internal async Task<IDisposable> TryObtainLockAsync(TimeSpan timeout)
                      {
                          // In case of zero-timeout, don't even wait for protective lock contention
                          if (timeout == TimeSpan.Zero)
                          {

            Method ReadString has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    private string ReadString(char quote)
                    {
                        var sb = new StringBuilder();
                        this.ReadChar(); // remove first " or '
            
            

              Method stbi__jpeg_huff_decode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      private int stbi__jpeg_huff_decode(stbi__huffman h)
                      {
                          uint temp = 0;
                          var c = 0;
                          var k = 0;

                Method TestThatAssertClassWorksCorrectly has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        [NUnit.Framework.Test]
                        public void TestThatAssertClassWorksCorrectly() {
                
                            Throws(() => { Assert.True(false); });
                            Throws(() => { Assert.False(true); });

                  Method OnLoad has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              public Task OnLoad(MyModel model) {
                                  var map = targetView.GetLinkMap();
                                  tripStartInput = map.Get<InputField>("TripStartInput");
                                  tripBackInput = map.Get<InputField>("TripBackInput");
                                  oneWayDropdown = map.Get<Dropdown>("OneWayDropdown");

                    Method ExpansionOfKnownRegionsHelper has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            private void ExpansionOfKnownRegionsHelper(byte[] image, byte[] trimap, int r, double c) {
                                int w = width;
                                int h = height;
                                // ... (Conversion logic) ...
                                for (var x = 0; x < w; ++x) {

                      Method NewLoggingDispatcher has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              private static Dispatcher NewLoggingDispatcher<T>(IDataStore<T> store, Dispatcher innerDispatcher, int maxMsBudgetForLoggingChanges, bool showStateDiff) {
                                  var showChangesJson = true;
                                  return (action) => {
                                      if (action is IsValid v && !v.IsValid()) {
                                          Log.e("Invalid action: " + asJson(action.GetType().Name, action));

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

                                        try
                                        {
                                            // read collection page
                                            var buffer = engine._disk.ReadPage(col.Value);
                                            var page = BasePage.ReadPage(buffer);
                        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Recovery/Recovery.cs on lines 146..160

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

                        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 textLocalized(this TMP_Text self, string key, params object[] args) {
                                    I18n i18n = I18n.instance(self);
                                    if (i18n == null) { i18n = SetupDefaultI18nInstance(self).Result; }
                                    var localizedText = i18n.Get(key, args);
                                    if (localizedText != self.text) { self.text = localizedText; }
                        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/localization/LocalizationExtensions.cs on lines 12..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 108.

                        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

                                        try
                                        {
                                            // try read page from disk and deserialize as IndexPage
                                            var buffer = engine._disk.ReadPage(item.Key);
                                            var page = BasePage.ReadPage(buffer);
                        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/UltraLiteDB/Recovery/Recovery.cs on lines 95..109

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

                        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 textLocalized(this TMP_InputField self, string key, params object[] args) {
                                    I18n i18n = I18n.instance(self);
                                    if (i18n == null) { i18n = SetupDefaultI18nInstance(self).Result; }
                                    var localizedText = i18n.Get(key, args);
                                    if (localizedText != self.text) { self.text = localizedText; }
                        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/ui/localization/LocalizationExtensions.cs on lines 27..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 108.

                        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 ((1) * 8 + (3)):
                                                for (i = (int)(x - 1); (i) >= (0); --i, src += 1, dest += 3)
                                                {
                                                    dest[0] = (byte)(dest[1] = (byte)(dest[2] = (byte)(src[0])));
                                                }
                        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/StbImageSharp/Utility/Conversion.cs on lines 167..172

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

                        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 ((2) * 8 + (3)):
                                                for (i = (int)(x - 1); (i) >= (0); --i, src += 2, dest += 3)
                                                {
                                                    dest[0] = (byte)(dest[1] = (byte)(dest[2] = (byte)(src[0])));
                                                }
                        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/StbImageSharp/Utility/Conversion.cs on lines 148..153

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

                        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

                                private static MyModel MyReducer(MyModel previousState, object action) {
                                    bool modelChanged = false;
                                    var selectedCircle = previousState.MutateField(previousState.selectedCircle, action, CircleSelectionReducer, ref modelChanged);
                                    var circles = previousState.MutateField(previousState.circles, action, CirclesReducer, ref modelChanged);
                                    if (modelChanged) { return new MyModel(selectedCircle, circles); }
                        CsCore/UnityTests/Assets/Plugins/CsCoreUnityDemoScenes/Ui24_7GUIsBechnmark/Task5_CRUD/Task5_CRUD.cs on lines 125..131

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

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language