fbredius/storybook

View on GitHub

Showing 5,758 of 5,758 total issues

File container.tsx has 578 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Component, Fragment, FunctionComponent, CSSProperties, ReactNode } from 'react';
import { styled, withTheme, Theme } from '@storybook/theming';
import { State } from '@storybook/api';
import * as persistence from './persist';

Severity: Major
Found in lib/ui/src/components/layout/container.tsx - About 1 day to fix

    File hooks.test.js has 574 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      FORCE_RE_RENDER,
      STORY_RENDERED,
      UPDATE_STORY_ARGS,
      RESET_STORY_ARGS,
    Severity: Major
    Found in lib/store/src/hooks.test.js - About 1 day to fix

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

            background:
              theme.base === 'light'
                ? `linear-gradient(to right, 
                  ${theme.color.green} 0%, ${theme.color.green} ${((value - min) / (max - min)) * 100}%, 
                  ${darken(0.02, theme.input.background)} ${((value - min) / (max - min)) * 100}%, 
      Severity: Major
      Found in lib/components/src/controls/Range.tsx and 2 other locations - About 1 day to fix
      lib/components/src/controls/Range.tsx on lines 21..30
      lib/components/src/controls/Range.tsx on lines 78..87

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

      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

            background:
              theme.base === 'light'
                ? `linear-gradient(to right, 
                  ${theme.color.green} 0%, ${theme.color.green} ${((value - min) / (max - min)) * 100}%, 
                  ${darken(0.02, theme.input.background)} ${((value - min) / (max - min)) * 100}%, 
      Severity: Major
      Found in lib/components/src/controls/Range.tsx and 2 other locations - About 1 day to fix
      lib/components/src/controls/Range.tsx on lines 78..87
      lib/components/src/controls/Range.tsx on lines 119..128

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

      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

            background:
              theme.base === 'light'
                ? `linear-gradient(to right, 
                  ${theme.color.green} 0%, ${theme.color.green} ${((value - min) / (max - min)) * 100}%, 
                  ${darken(0.02, theme.input.background)} ${((value - min) / (max - min)) * 100}%, 
      Severity: Major
      Found in lib/components/src/controls/Range.tsx and 2 other locations - About 1 day to fix
      lib/components/src/controls/Range.tsx on lines 21..30
      lib/components/src/controls/Range.tsx on lines 119..128

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      File CsfFile.test.ts has 555 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable no-underscore-dangle */
      import dedent from 'ts-dedent';
      import yaml from 'js-yaml';
      import { loadCsf } from './CsfFile';
      
      
      Severity: Major
      Found in lib/csf-tools/src/CsfFile.test.ts - About 1 day to fix

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

        export function extractSource(location: SourceBlock, lines: string[]): string | null {
          const { startBody: start, endBody: end } = location;
          if (start.line === end.line && lines[start.line - 1] !== undefined) {
            return lines[start.line - 1].substring(start.col, end.col);
          }
        Severity: Major
        Found in lib/source-loader/src/extract-source.ts and 1 other location - About 1 day to fix
        addons/docs/src/blocks/enhanceSource.ts on lines 31..47

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 220.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        function extractSource(location: SourceBlock, lines: string[]): string | null {
          const { startBody: start, endBody: end } = location;
          if (start.line === end.line && lines[start.line - 1] !== undefined) {
            return lines[start.line - 1].substring(start.col, end.col);
          }
        Severity: Major
        Found in addons/docs/src/blocks/enhanceSource.ts and 1 other location - About 1 day to fix
        lib/source-loader/src/extract-source.ts on lines 8..24

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 220.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

              it('applies loaders with story context', async () => {
                document.location.search = '?id=component-one--a&viewMode=docs';
                await createAndRenderPreview();
        
                mockChannel.emit.mockClear();
        Severity: Major
        Found in lib/preview-web/src/PreviewWeb.test.ts and 1 other location - About 1 day to fix
        lib/preview-web/src/PreviewWeb.test.ts on lines 1320..1345

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 219.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

              it('applies loaders with story context', async () => {
                document.location.search = '?id=component-one--a';
                await createAndRenderPreview();
        
                mockChannel.emit.mockClear();
        Severity: Major
        Found in lib/preview-web/src/PreviewWeb.test.ts and 1 other location - About 1 day to fix
        lib/preview-web/src/PreviewWeb.test.ts on lines 1883..1908

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 219.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

                          <div
                            id="passing-tests"
                            title={`${
                              testsByType.get(StatusTypes.PASSED_TYPE)
                                ? testsByType.get(StatusTypes.PASSED_TYPE).length
        Severity: Major
        Found in addons/jest/src/components/Panel.tsx and 3 other locations - About 1 day to fix
        addons/jest/src/components/Panel.tsx on lines 159..181
        addons/jest/src/components/Panel.tsx on lines 205..227
        addons/jest/src/components/Panel.tsx on lines 228..250

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

        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

                          <div
                            id="failing-tests"
                            title={`${
                              testsByType.get(StatusTypes.FAILED_TYPE)
                                ? testsByType.get(StatusTypes.FAILED_TYPE).length
        Severity: Major
        Found in addons/jest/src/components/Panel.tsx and 3 other locations - About 1 day to fix
        addons/jest/src/components/Panel.tsx on lines 182..204
        addons/jest/src/components/Panel.tsx on lines 205..227
        addons/jest/src/components/Panel.tsx on lines 228..250

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

        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

                          <div
                            id="todo-tests"
                            title={`${
                              testsByType.get(StatusTypes.TODO_TYPE)
                                ? testsByType.get(StatusTypes.TODO_TYPE).length
        Severity: Major
        Found in addons/jest/src/components/Panel.tsx and 3 other locations - About 1 day to fix
        addons/jest/src/components/Panel.tsx on lines 159..181
        addons/jest/src/components/Panel.tsx on lines 182..204
        addons/jest/src/components/Panel.tsx on lines 205..227

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

        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

                          <div
                            id="pending-tests"
                            title={`${
                              testsByType.get(StatusTypes.PENDING_TYPE)
                                ? testsByType.get(StatusTypes.PENDING_TYPE).length
        Severity: Major
        Found in addons/jest/src/components/Panel.tsx and 3 other locations - About 1 day to fix
        addons/jest/src/components/Panel.tsx on lines 159..181
        addons/jest/src/components/Panel.tsx on lines 182..204
        addons/jest/src/components/Panel.tsx on lines 228..250

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

        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

          constructor(props: JsonFunctionValueProps) {
            super(props);
            const keyPath = [...props.keyPath, props.name];
            this.state = {
              value: props.value,
        lib/components/src/controls/react-editable-json-tree/JsonNodes.tsx on lines 1407..1425

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

        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

          constructor(props: JsonValueProps) {
            super(props);
            const keyPath = [...props.keyPath, props.name];
            this.state = {
              value: props.value,
        lib/components/src/controls/react-editable-json-tree/JsonNodes.tsx on lines 506..524

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

        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

              it('emits STORY_PREPARED', async () => {
                document.location.search = '?id=component-one--a';
                await createAndRenderPreview();
        
                mockChannel.emit.mockClear();
        Severity: Major
        Found in lib/preview-web/src/PreviewWeb.test.ts and 1 other location - About 1 day to fix
        lib/preview-web/src/PreviewWeb.test.ts on lines 1858..1881

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

        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

              it('emits STORY_PREPARED', async () => {
                document.location.search = '?id=component-one--a&viewMode=docs';
                await createAndRenderPreview();
        
                mockChannel.emit.mockClear();
        Severity: Major
        Found in lib/preview-web/src/PreviewWeb.test.ts and 1 other location - About 1 day to fix
        lib/preview-web/src/PreviewWeb.test.ts on lines 1295..1318

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

        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

        Function storySort has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
        Open

          (options: StorySortObjectParameter = {}): StorySortComparatorV7 =>
          (a: StoryIndexEntry, b: StoryIndexEntry): number => {
            // If the two stories have the same story kind, then use the default
            // ordering, which is the order they are defined in the story file.
            // only when includeNames is falsy
        Severity: Minor
        Found in lib/store/src/storySort.ts - About 1 day to fix

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

        export const PropsWriter = ({
          numberOptional = 1,
          stringOptional = 'stringOptional',
          booleanOptional = false,
          arrayOptional = ['array', 'optional'],
        addons/docs/src/frameworks/react/__testfixtures__/js-function-component-inline-defaults-no-propTypes/input.js on lines 11..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 211.

        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