cs-util-com/cscore

View on GitHub

Showing 1,140 of 1,140 total issues

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

            defaultSolverIterationsInput.SetOnValueChangedAction(x => {
                if (int.TryParse(x, out int newSolverIterations) && newSolverIterations > 1 && newSolverIterations < 10) {
                    model.DefaultSolverIterations = newSolverIterations;
                    RefreshSettingsUi(model);
                    return true;
CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/system/settings/GraphicsSettingsUi.cs on lines 71..78
CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/system/settings/GraphicsSettingsUi.cs on lines 83..90

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

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 CalcAllPolynomialFunctionsWithRansac has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        public static PolynomialFunction CalcAllPolynomialFunctionsWithRansac(IReadOnlyList<Vector2> points, Random rnd, double inlierDistance, float percent = 0.2f, int iterations = 1000, int maxCoefficientCount = 21) {

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

                shadowDistanceInput.SetOnValueChangedAction(x => {
                    if (float.TryParse(x, out float shadowRenderDistance) && shadowRenderDistance > 1 && shadowRenderDistance < 5000) {
                        model.ShadowDistance = shadowRenderDistance;
                        RefreshSettingsUi(model);
                        return true;
    CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/system/settings/GraphicsSettingsUi.cs on lines 83..90
    CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/system/settings/GraphicsSettingsUi.cs on lines 125..132

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

    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 CalcEntryChanges has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            public static void CalcEntryChanges<T, K>(this IEnumerable<T> oldState, IEnumerable<T> newState, Func<T, K> getKey, Action<T> onEntryAdded, Action<T> onEntryUpdated, Action<K> onEntryRemoved) {

      Method CalcEntryChangesToOldState has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              public static void CalcEntryChangesToOldState<E, K, V>(this E newState, ref E oldState, Func<V, K> getKey, Action<V> onEntryAdded, Action<V, V> onEntryUpdated, Action<K> onEntryRemoved) where E : IEnumerable<V> {

        Method ValidateReadyToRead has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
        Open

                private void ValidateReadyToRead()
                {
                    if (m_NeedPropertyCheck | ArrayHasChanged())
                    {
                        switch (m_TextFieldType)

        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

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

                    cameraRenderDistanceInput.SetOnValueChangedAction(x => {
                        if (float.TryParse(x, out float camRenderDistance) && camRenderDistance > 1 && camRenderDistance < 5000) {
                            model.CameraRenderDistance = camRenderDistance;
                            RefreshSettingsUi(model);
                            return true;
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/system/settings/GraphicsSettingsUi.cs on lines 71..78
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/system/settings/GraphicsSettingsUi.cs on lines 125..132

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

        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 LogInfo(string msg, params object[] args) {
                    PrintInfoMessage("> INFO: " + msg + Log.ToArgsStr(args, ArgToString) + LB
                        + "  * at " + Log.CallingMethodStr(args) + LB + LB, args);
                }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/LogDefaultImpl.cs on lines 12..15
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/LogDefaultImpl.cs on lines 22..25

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

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

                public override async Task<bool> Remove(string key) {
                    this.ThrowErrorIfDisposed();
                    var res = await base.Remove(key);
                    foreach (var s in _categoryStores.Values) { res &= await s.Remove(key); }
                    return res;
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/analytics/LocalAnalytics.cs on lines 48..53
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/analytics/LocalAnalyticsV3.cs on lines 46..51

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

        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

                    {
                        for (i = (uint)0; i < pixel_count; ++i)
                        {
                            var t = p[0];
                            p[0] = p[2];
        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/StbImageSharp/Decoding/PngDecoder.cs on lines 581..588

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

        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

                    foreach (var op in toModify)
                    {
                        JToken p = Unpatch(right[int.Parse(op.Name)], op.Value);
                        right[int.Parse(op.Name)] = p;
                    }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/JsonDotNet/JsonDiffPatch/JsonDiffPatch.cs on lines 540..544

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

        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

                        else
                            for (i = (uint)0; i < pixel_count; ++i)
                            {
                                var t = p[0];
                                p[0] = p[2];
        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/StbImageSharp/Decoding/PngDecoder.cs on lines 550..558

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

        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

                    foreach (var op in toModify)
                    {
                        JToken p = Patch(left[int.Parse(op.Name)], op.Value);
                        left[int.Parse(op.Name)] = p;
                    }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/JsonDotNet/JsonDiffPatch/JsonDiffPatch.cs on lines 634..638

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

        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 static Task<T> OnError<T>(this Task<T> self, Func<Exception, Task<T>> onError) {
                    try { // Catch in case current sync context is not allowed to be used as a scheduler (e.g in xUnit)
                        return self.ContinueWith(HandleIfError(onError), TaskScheduler.FromCurrentSynchronizationContext()).Unwrap();
                    } catch (Exception) { return self.ContinueWith(HandleIfError(onError)).Unwrap(); }
                }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/extensions/TaskExtensions.cs on lines 35..39

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

        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 static Task OnError(this Task self, Func<Exception, Task> onError) {
                    try { // Catch in case current sync context is not allowed to be used as a scheduler (e.g in xUnit)
                        return self.ContinueWith(HandleIfError(onError), TaskScheduler.FromCurrentSynchronizationContext()).Unwrap();
                    } catch (Exception) { return self.ContinueWith(HandleIfError(onError)).Unwrap(); }
                }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/extensions/TaskExtensions.cs on lines 41..45

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

        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

                        else
                        {
                            if (property == null)
                            {
                                target.Add(new JProperty(diff.Name, Unpatch(null, patchValue)));
        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/JsonDotNet/JsonDiffPatch/JsonDiffPatch.cs on lines 466..476

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

        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 IsNull(object o, string varName, params object[] args) {
                    string errorMsg = $"Assert.IsNull({varName}) FAILED";
                    Assert(o == null, errorMsg, args);
                }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/AssertV2.cs on lines 79..83

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

        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

                        else
                        {
                            if (property == null)
                            {
                                target.Add(new JProperty(diff.Name, Patch(null, patchValue)));
        CsCore/PlainNetClassLib/src/Plugins/CsCore/libs/JsonDotNet/JsonDiffPatch/JsonDiffPatch.cs on lines 569..579

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

        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 IsNotNull(object o, string varName, params object[] args) {
                    string errorMsg = $"Assert.IsNotNull({varName}) FAILED";
                    Assert(o != null, errorMsg, args);
                }
        CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/logging/AssertV2.cs on lines 73..77

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

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

                    EventBus.instance.Subscribe(self, EventConsts.catView + EventConsts.ADDED, (GameObject view) => {
                        self.TrackEvent(EventConsts.catView, EventConsts.ADDED + "_" + view.name, view);
                    });
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/logging/AppFlowUnityExtensions.cs on lines 64..66
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/logging/AppFlowUnityExtensions.cs on lines 79..81
        CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/logging/AppFlowUnityExtensions.cs on lines 94..96

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

        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