HabitatMap/AirCasting

View on GitHub

Showing 667 of 667 total issues

Avoid deeply nested control flow statements.
Open

            if (isActive) {
              dispatch(
                fetchActiveIndoorSessions({ filters: indoorSessionsFilters })
              ).unwrap();
            } else {
Severity: Major
Found in app/javascript/react/components/Map/Map.tsx - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if (isActive) {
                  dispatch(fetchActiveFixedSessions({ filters })).unwrap();
                } else {
                  dispatch(fetchDormantFixedSessions({ filters })).unwrap();
                }
    Severity: Major
    Found in app/javascript/react/components/Map/Map.tsx - About 45 mins to fix

      Function TimelapseComponent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      > = React.memo(({ onClose }) => {
        const [showReadOnlyPopup, setShowReadOnlyPopup] = useState(false);
        const [currentStep, setCurrentStep] = useState(0);
      
        const isLoading = useAppSelector(selectTimelapseIsLoading);

      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

      Function getMonthWeeksOfDailyAveragesFor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      const getMonthWeeksOfDailyAveragesFor = (
        month: Moment,
        streamDailyAverages: StreamDailyAverage[]
      ): CalendarMonthlyData => {
        if (!month || !month.isValid() || !streamDailyAverages) {
      Severity: Minor
      Found in app/javascript/react/store/movingStreamSelectors.ts - About 45 mins 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

      Function CrowdMapMarkers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      const CrowdMapMarkers = ({ pulsatingSessionId, sessions }: Props) => {
        const dispatch = useAppDispatch();
      
        const crowdMapRectangles = useAppSelector(selectCrowdMapRectangles);
        const fetchingCrowdMapData = useAppSelector(selectFetchingCrowdMapData);
      Severity: Minor
      Found in app/javascript/react/components/Map/Markers/CrowdMapMarkers.tsx - About 45 mins 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

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

      type CustomPopupProps = {
        children:
          | React.ReactNode
          | ((close: () => void, isOpen: boolean) => React.ReactNode);
      };
      Severity: Major
      Found in app/javascript/react/components/Popups/ExportDataComponent.tsx and 3 other locations - About 45 mins to fix
      app/javascript/react/components/Modals/SessionDetailsModal/SessionDetailsModal.tsx on lines 19..23
      app/javascript/react/components/Popups/CopyLinkComponent.tsx on lines 11..15
      app/javascript/react/components/SessionFilters/FilterInfoPopup.tsx on lines 8..12

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

      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

      const ScrollButton = ({ children, ...props }: ButtonProps) => (
        <S.ScrollButton {...props}>{children}</S.ScrollButton>
      );
      Severity: Major
      Found in app/javascript/react/components/ScrollButton/ScrollButton.tsx and 2 other locations - About 45 mins to fix
      app/javascript/react/components/ActionButton/ActionButton.tsx on lines 10..12
      app/javascript/react/components/Button/Button.tsx on lines 10..12

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

      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

      const Button = ({ children, ...props }: ButtonProps) => (
        <S.Button {...props}>{children}</S.Button>
      );
      Severity: Major
      Found in app/javascript/react/components/Button/Button.tsx and 2 other locations - About 45 mins to fix
      app/javascript/react/components/ActionButton/ActionButton.tsx on lines 10..12
      app/javascript/react/components/ScrollButton/ScrollButton.tsx on lines 11..13

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

      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

      const ActionButton = ({ children, ...props }: ButtonProps) => (
        <S.ActionButton {...props}>{children}</S.ActionButton>
      );
      Severity: Major
      Found in app/javascript/react/components/ActionButton/ActionButton.tsx and 2 other locations - About 45 mins to fix
      app/javascript/react/components/Button/Button.tsx on lines 10..12
      app/javascript/react/components/ScrollButton/ScrollButton.tsx on lines 11..13

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

      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

          case colors.red:
            return `linear-gradient(241deg, ${hexToRGBA(colors.royalPurple, 0.4)} -38.43%, ${hexToRGBA(colors.royalPurple, 0)} 94.94%), ${colors.red}`;
      Severity: Major
      Found in app/javascript/react/utils/thresholdColors.ts and 3 other locations - About 45 mins to fix
      app/javascript/react/utils/thresholdColors.ts on lines 33..34
      app/javascript/react/utils/thresholdColors.ts on lines 37..38
      app/javascript/react/utils/thresholdColors.ts on lines 39..40

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

      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

      const ButtonSpan = styled(HeaderTitle)<{ $isActive: boolean }>`
        color: ${(props) => (props.$isActive ? acBlue : gray400)};
        margin: 0;
      `;
      app/javascript/react/components/MapButtons/MapButtons.style.tsx on lines 43..46
      app/javascript/react/components/SessionFilters/SessionFilters.style.tsx on lines 354..356

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

      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

      const Title = styled(H4)<{ $isActive?: boolean }>`
        color: ${(props) => (props.$isActive ? white : gray300)};
        margin-right: 0.8rem;
      `;
      app/javascript/react/components/SessionFilters/SessionFilters.style.tsx on lines 354..356
      app/javascript/react/components/SessionFilters/SessionFilters.style.tsx on lines 480..483

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

      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

      const Label = styled.span<{ $isActive?: boolean }>`
        color: ${(props) => (props.$isActive ? blue : gray400)};
        margin: 0 1rem;
        display: flex;
        align-items: center;
      app/javascript/react/components/Toggle/Toggle.style.tsx on lines 79..88

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

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

      type CustomPopupProps = {
        children:
          | React.ReactNode
          | ((close: () => void, isOpen: boolean) => React.ReactNode);
      };
      app/javascript/react/components/Popups/CopyLinkComponent.tsx on lines 11..15
      app/javascript/react/components/Popups/ExportDataComponent.tsx on lines 32..36
      app/javascript/react/components/SessionFilters/FilterInfoPopup.tsx on lines 8..12

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

      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

      const H4 = styled.h4<{ bold?: boolean }>`
        font-weight: ${(p) => (p.bold ? "600" : "400")};
        font-size: 14px;
        letter-spacing: 0.14px;
      `;
      app/javascript/react/components/Navbar/NavList/NavList.style.tsx on lines 74..77
      app/javascript/react/components/Typography/Typography.style.tsx on lines 14..17
      app/javascript/react/components/Typography/Typography.style.tsx on lines 25..28

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

      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

      const SelectedOption = styled(H4)<{ $isSelected: boolean }>`
        color: ${(props) => (props.$isSelected ? gray400 : gray300)};
      `;
      app/javascript/react/components/MapButtons/MapButtons.style.tsx on lines 43..46
      app/javascript/react/components/SessionFilters/SessionFilters.style.tsx on lines 480..483

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

      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

      const H5 = styled.h5<{ bold?: boolean }>`
        font-weight: ${(p) => (p.bold ? "600" : "400")};
        font-size: 12px;
      `;
      app/javascript/react/components/Navbar/NavList/NavList.style.tsx on lines 74..77
      app/javascript/react/components/Typography/Typography.style.tsx on lines 14..17
      app/javascript/react/components/Typography/Typography.style.tsx on lines 19..23

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

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

      type CustomPopupProps = {
        children:
          | React.ReactNode
          | ((close: () => void, isOpen: boolean) => React.ReactNode);
      };
      Severity: Major
      Found in app/javascript/react/components/Popups/CopyLinkComponent.tsx and 3 other locations - About 45 mins to fix
      app/javascript/react/components/Modals/SessionDetailsModal/SessionDetailsModal.tsx on lines 19..23
      app/javascript/react/components/Popups/ExportDataComponent.tsx on lines 32..36
      app/javascript/react/components/SessionFilters/FilterInfoPopup.tsx on lines 8..12

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

      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

      const ListItem = styled.li<{ $isActive?: boolean }>`
        border-bottom: none;
        opacity: ${(p) => (p.$isActive ? "0.5" : "1")};
      `;
      app/javascript/react/components/Typography/Typography.style.tsx on lines 14..17
      app/javascript/react/components/Typography/Typography.style.tsx on lines 19..23
      app/javascript/react/components/Typography/Typography.style.tsx on lines 25..28

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

      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

      const H3 = styled.h3<{ bold?: boolean }>`
        font-weight: ${(p) => (p.bold ? "600" : "400")};
        font-size: 18px;
      `;
      app/javascript/react/components/Navbar/NavList/NavList.style.tsx on lines 74..77
      app/javascript/react/components/Typography/Typography.style.tsx on lines 19..23
      app/javascript/react/components/Typography/Typography.style.tsx on lines 25..28

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

      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