Showing 130 of 130 total issues

File emojis.ts has 1793 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export const emojis = [
  '😀',
  '😁',
  '😂',
  '🤣',
Severity: Major
Found in demo/src/emojis.ts - About 4 days to fix

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

    const ballots: Ballot[] = [
      { weight: 2, ranking: [[3], [2, 4], [1], [5]] },
      { weight: 3, ranking: [[5], [4], [2], [1], [3]] },
      { weight: 5, ranking: [[4], [5], [3], [2], [1]] },
      { weight: 7, ranking: [[4], [2, 5], [3], [1]] },
    Severity: Major
    Found in votes/src/test/condorcet-mess.ts and 1 other location - About 1 day to fix
    demo/src/premade/condorcet-mess.ts on lines 5..18

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

    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 ballots: Ballot[] = [
      { weight: 2, ranking: [[3], [2, 4], [1], [5]] },
      { weight: 3, ranking: [[5], [4], [2], [1], [3]] },
      { weight: 5, ranking: [[4], [5], [3], [2], [1]] },
      { weight: 7, ranking: [[4], [2, 5], [3], [1]] },
    Severity: Major
    Found in demo/src/premade/condorcet-mess.ts and 1 other location - About 1 day to fix
    votes/src/test/condorcet-mess.ts on lines 5..18

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

    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 descriptions.tsx has 504 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from 'react'
    import { GithubOutlined } from '@ant-design/icons'
    
    import { VotingSystem } from 'votes'
    
    
    Severity: Major
    Found in demo/src/methods/descriptions.tsx - About 1 day to fix

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

      export const VizRandomizedCondorcet: React.FC = () => {
        const matrix = useStore(selectMatrix)
        const randomizedCondorcet = new RandomizedCondorcet(matrix)
      
        const candidatesById = useCandidatesById()
      demo/src/methods/maximal-lotteries/viz-maximal-lotteries.tsx on lines 10..29
      demo/src/methods/schulze/viz-schulze.tsx on lines 10..29

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

      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

      export const VizSchulze: React.FC = () => {
        const matrix = useStore(selectMatrix)
        const schulze = new Schulze(matrix)
      
        const candidatesById = useCandidatesById()
      Severity: Major
      Found in demo/src/methods/schulze/viz-schulze.tsx and 2 other locations - About 7 hrs to fix
      demo/src/methods/maximal-lotteries/viz-maximal-lotteries.tsx on lines 10..29
      demo/src/methods/randomized-condorcet/viz-randomized-condorcet.tsx on lines 10..31

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

      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

      export const VizMaximalLotteries: React.FC = () => {
        const matrix = useStore(selectMatrix)
        const maximalLotteries = new MaximalLotteries(matrix)
      
        const candidatesById = useCandidatesById()
      demo/src/methods/randomized-condorcet/viz-randomized-condorcet.tsx on lines 10..31
      demo/src/methods/schulze/viz-schulze.tsx on lines 10..29

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

      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 viz-borda.tsx has 461 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { useLayoutEffect, useMemo, useRef, useState } from 'react'
      import { ArrowLeftOutlined, ArrowRightOutlined } from '@ant-design/icons'
      import { a, to, useSpring } from '@react-spring/web'
      import { useHover } from '@use-gesture/react'
      import { Button } from 'antd'
      Severity: Minor
      Found in demo/src/methods/borda/viz-borda.tsx - About 7 hrs to fix

        Function forceLink has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

        export function forceLink<
          NodeDatum extends SimulationNodeDatum,
          LinkDatum extends SimulationLinkDatum<NodeDatum> & { weight: number },
        >(links: LinkDatum[] | null): Force {
          let id = index,
        Severity: Minor
        Found in demo/src/force-link.ts - About 6 hrs 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 VizNanson: React.FC = () => {
          const ballots = useStore(selectBallots)
          const candidatesById = useCandidatesById()
          const candidatesString = useCandidatesString()
          const bordiScores = new Borda({
        Severity: Major
        Found in demo/src/methods/nanson/result.tsx and 1 other location - About 6 hrs to fix
        demo/src/methods/baldwin/result.tsx on lines 17..34

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

        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

        export const VizBaldin: React.FC = () => {
          const ballots = useStore(selectBallots)
          const candidatesById = useCandidatesById()
          const candidatesString = useCandidatesString()
          const bordiScores = new Borda({
        Severity: Major
        Found in demo/src/methods/baldwin/result.tsx and 1 other location - About 6 hrs to fix
        demo/src/methods/nanson/result.tsx on lines 17..34

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

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

        export const ListVotesGroup: React.FC = () => {
          const ballots = useStore(selectBallots)
          const changeBallotWeight = useStore(selectChangeBallotWeight)
          const selectBallot = useStore(selectSelectBallot)
          const selectedBallot = useStore(selectSelectedBallot)
        Severity: Major
        Found in demo/src/list-votes-group.tsx - About 5 hrs to fix

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

          const ballots: Ballot[] = [
            { weight: 18, ranking: [0, 1, 2, 4, 3] },
            { weight: 19, ranking: [1, 0, 2, 4, 3] },
            { weight: 20, ranking: [2, 0, 1, 3, 4] },
            { weight: 21, ranking: [3, 0, 1, 2, 4] },
          Severity: Major
          Found in demo/src/premade/bad-two-rounds.ts and 1 other location - About 5 hrs to fix
          demo/src/premade/bad-fptp.ts on lines 5..11

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

          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 ballots: Ballot[] = [
            { weight: 10, ranking: [0, 1, 2, 3, 4] },
            { weight: 10, ranking: [1, 0, 2, 3, 4] },
            { weight: 10, ranking: [2, 0, 1, 3, 4] },
            { weight: 9, ranking: [3, 0, 1, 2, 4] },
          Severity: Major
          Found in demo/src/premade/bad-fptp.ts and 1 other location - About 5 hrs to fix
          demo/src/premade/bad-two-rounds.ts on lines 41..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 148.

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

          export const VizBottomTwo: React.FC = () => {
            const _ballots = useStore(selectBallots)
            const candidatesStrings = useCandidatesString()
          
            const [rounds] = useMemo(() => {
          Severity: Major
          Found in demo/src/methods/bottom-two/viz-bottom-two.tsx and 4 other locations - About 4 hrs to fix
          demo/src/methods/baldwin/viz-baldwin.tsx on lines 10..23
          demo/src/methods/coombs/viz-coombs.tsx on lines 10..22
          demo/src/methods/instant-runoff/viz-instant-runoff.tsx on lines 11..24
          demo/src/methods/nanson/viz-nanson.tsx on lines 33..46

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

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

          export const VizInstantRunoff: React.FC = () => {
            const _ballots = useStore(selectBallots)
            const candidatesStrings = useCandidatesString()
          
            const [rounds] = useMemo(() => {
          Severity: Major
          Found in demo/src/methods/instant-runoff/viz-instant-runoff.tsx and 4 other locations - About 4 hrs to fix
          demo/src/methods/baldwin/viz-baldwin.tsx on lines 10..23
          demo/src/methods/bottom-two/viz-bottom-two.tsx on lines 10..22
          demo/src/methods/coombs/viz-coombs.tsx on lines 10..22
          demo/src/methods/nanson/viz-nanson.tsx on lines 33..46

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

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

          export const VizBaldinTreemap: React.FC = () => {
            const _ballots = useStore(selectBallots)
            const candidatesStrings = useCandidatesString()
          
            const [rounds] = useMemo(() => {
          Severity: Major
          Found in demo/src/methods/baldwin/viz-baldwin.tsx and 4 other locations - About 4 hrs to fix
          demo/src/methods/bottom-two/viz-bottom-two.tsx on lines 10..22
          demo/src/methods/coombs/viz-coombs.tsx on lines 10..22
          demo/src/methods/instant-runoff/viz-instant-runoff.tsx on lines 11..24
          demo/src/methods/nanson/viz-nanson.tsx on lines 33..46

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

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

          export const VizCoombs: React.FC = () => {
            const _ballots = useStore(selectBallots)
            const candidatesStrings = useCandidatesString()
          
            const [rounds] = useMemo(() => {
          Severity: Major
          Found in demo/src/methods/coombs/viz-coombs.tsx and 4 other locations - About 4 hrs to fix
          demo/src/methods/baldwin/viz-baldwin.tsx on lines 10..23
          demo/src/methods/bottom-two/viz-bottom-two.tsx on lines 10..22
          demo/src/methods/instant-runoff/viz-instant-runoff.tsx on lines 11..24
          demo/src/methods/nanson/viz-nanson.tsx on lines 33..46

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

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

          export const VizNansonTreemap: React.FC = () => {
            const _ballots = useStore(selectBallots)
            const candidatesStrings = useCandidatesString()
          
            const [rounds] = useMemo(() => {
          Severity: Major
          Found in demo/src/methods/nanson/viz-nanson.tsx and 4 other locations - About 4 hrs to fix
          demo/src/methods/baldwin/viz-baldwin.tsx on lines 10..23
          demo/src/methods/bottom-two/viz-bottom-two.tsx on lines 10..22
          demo/src/methods/coombs/viz-coombs.tsx on lines 10..22
          demo/src/methods/instant-runoff/viz-instant-runoff.tsx on lines 11..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 125.

          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

            return (
              <div className="container" ref={ref}>
                <p>Smith set</p>
                <CandiTagList
                  candidates={smith.candidates.map((c) => candidatesById[c])}
          Severity: Major
          Found in demo/src/methods/minimax-td/viz-minimax-td.tsx and 1 other location - About 4 hrs to fix
          demo/src/methods/smith/viz-smith.tsx on lines 15..29

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

          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