KarrLab/wc_kb

View on GitHub

Showing 90 of 90 total issues

File core.py has 1624 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" Core schema to represent a knowledge base to build models

:Author: Balazs Szigeti <balazs.szigeti@mssm.edu>
:Author: Jonathan Karr <karr@mssm.edu>
:Author: Bilal Shaikh  <bilal.shaikh@columbia.edu>
Severity: Major
Found in wc_kb/core.py - About 4 days to fix

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

            formula.H = 7 * n_a + 14 * n_r + 8 * n_n + 7 * n_d + 7 * n_c + \
                10 * n_q + 9 * n_e + 5 * n_g + 9 * n_h + 13 * n_i + \
                13 * n_l + 14 * n_k + 11 * n_m + 11 * n_f + 9 * n_p + \
                7 * n_s + 9 * n_t + 12 * n_w + 11 * n_y + 11 * n_v + \
                7 * n_u - 2 * (l - 1)
    Severity: Major
    Found in wc_kb/eukaryote.py and 1 other location - About 2 days to fix
    wc_kb/prokaryote.py on lines 215..219

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

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

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

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

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

    Refactorings

    Further Reading

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

            formula.H = 7 * n_a + 14 * n_r + 8 * n_n + 7 * n_d + 7 * n_c + \
                10 * n_q + 9 * n_e + 5 * n_g + 9 * n_h + 13 * n_i + \
                13 * n_l + 14 * n_k + 11 * n_m + 11 * n_f + 9 * n_p + \
                7 * n_s + 9 * n_t + 12 * n_w + 11 * n_y + 11 * n_v + \
                7 * n_u - 2 * (l - 1)
    Severity: Major
    Found in wc_kb/prokaryote.py and 1 other location - About 2 days to fix
    wc_kb/eukaryote.py on lines 655..659

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

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

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

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

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

    Refactorings

    Further Reading

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

            formula.O = 2 * n_a + 2 * n_r + 3 * n_n + 4 * n_d + 2 * n_c + \
                3 * n_q + 4 * n_e + 2 * n_g + 2 * n_h + 2 * n_i + \
                2 * n_l + 2 * n_k + 2 * n_m + 2 * n_f + 2 * n_p + \
                3 * n_s + 3 * n_t + 2 * n_w + 3 * n_y + 2 * n_v + \
                2 * n_u - (l - 1)
    Severity: Major
    Found in wc_kb/eukaryote.py and 1 other location - About 2 days to fix
    wc_kb/prokaryote.py on lines 227..231

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

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

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

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

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

    Refactorings

    Further Reading

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

            formula.O = 2 * n_a + 2 * n_r + 3 * n_n + 4 * n_d + 2 * n_c + \
                3 * n_q + 4 * n_e + 2 * n_g + 2 * n_h + 2 * n_i + \
                2 * n_l + 2 * n_k + 2 * n_m + 2 * n_f + 2 * n_p + \
                3 * n_s + 3 * n_t + 2 * n_w + 3 * n_y + 2 * n_v + \
                2 * n_u - (l - 1)
    Severity: Major
    Found in wc_kb/prokaryote.py and 1 other location - About 2 days to fix
    wc_kb/eukaryote.py on lines 667..671

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

    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

            formula.N = 1 * n_a + 4 * n_r + 2 * n_n + 1 * n_d + 1 * n_c + \
                2 * n_q + 1 * n_e + 1 * n_g + 3 * n_h + 1 * n_i + \
                1 * n_l + 2 * n_k + 1 * n_m + 1 * n_f + 1 * n_p + \
                1 * n_s + 1 * n_t + 2 * n_w + 1 * n_y + 1 * n_v + \
                1 * n_u
    Severity: Major
    Found in wc_kb/prokaryote.py and 3 other locations - About 2 days to fix
    wc_kb/eukaryote.py on lines 649..653
    wc_kb/eukaryote.py on lines 661..665
    wc_kb/prokaryote.py on lines 209..213

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

    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

            formula.C = 3 * n_a + 6 * n_r + 4 * n_n + 4 * n_d + 3 * n_c + \
                5 * n_q + 5 * n_e + 2 * n_g + 6 * n_h + 6 * n_i + \
                6 * n_l + 6 * n_k + 5 * n_m + 9 * n_f + 5 * n_p + \
                3 * n_s + 4 * n_t + 11 * n_w + 9 * n_y + 5 * n_v + \
                3 * n_u
    Severity: Major
    Found in wc_kb/eukaryote.py and 3 other locations - About 2 days to fix
    wc_kb/eukaryote.py on lines 661..665
    wc_kb/prokaryote.py on lines 209..213
    wc_kb/prokaryote.py on lines 221..225

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

    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

            formula.C = 3 * n_a + 6 * n_r + 4 * n_n + 4 * n_d + 3 * n_c + \
                5 * n_q + 5 * n_e + 2 * n_g + 6 * n_h + 6 * n_i + \
                6 * n_l + 6 * n_k + 5 * n_m + 9 * n_f + 5 * n_p + \
                3 * n_s + 4 * n_t + 11 * n_w + 9 * n_y + 5 * n_v + \
                3 * n_u
    Severity: Major
    Found in wc_kb/prokaryote.py and 3 other locations - About 2 days to fix
    wc_kb/eukaryote.py on lines 649..653
    wc_kb/eukaryote.py on lines 661..665
    wc_kb/prokaryote.py on lines 221..225

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

    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

            formula.N = 1 * n_a + 4 * n_r + 2 * n_n + 1 * n_d + 1 * n_c + \
                2 * n_q + 1 * n_e + 1 * n_g + 3 * n_h + 1 * n_i + \
                1 * n_l + 2 * n_k + 1 * n_m + 1 * n_f + 1 * n_p + \
                1 * n_s + 1 * n_t + 2 * n_w + 1 * n_y + 1 * n_v + \
                1 * n_u
    Severity: Major
    Found in wc_kb/eukaryote.py and 3 other locations - About 2 days to fix
    wc_kb/eukaryote.py on lines 649..653
    wc_kb/prokaryote.py on lines 209..213
    wc_kb/prokaryote.py on lines 221..225

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

    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

            if isinstance(ws.cell(1, 1).value, str) and ws.cell(1, 1).value.startswith('!!'):
                table_head_cell = ws.cell(1, 1)
                matches = re.findall(r" +(.*?)=('((?:[^'\\]|\\.)*)'|\"((?:[^\"\\]|\\.)*)\")",
                    ws.cell(1, 1).value)
                heading, _, _ = ws.cell(1, 1).value.partition(' ')
    Severity: Major
    Found in migrations/migration_2020_03_09.py and 1 other location - About 1 day to fix
    migrations/migration_2020_03_09.py on lines 36..43

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

    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

            if isinstance(ws.cell(2, 1).value, str) and ws.cell(2, 1).value.startswith('!!'):
                table_head_cell = ws.cell(2, 1)
                matches = re.findall(r" +(.*?)=('((?:[^'\\]|\\.)*)'|\"((?:[^\"\\]|\\.)*)\")",
                    ws.cell(2, 1).value)
                heading, _, _ = ws.cell(2, 1).value.partition(' ')
    Severity: Major
    Found in migrations/migration_2020_03_09.py and 1 other location - About 1 day to fix
    migrations/migration_2020_03_09.py on lines 27..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 140.

    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 eukaryote.py has 559 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """ Schema to represent a knowledge base to build models of eukaryotes
    
    :Author: Yin Hoon Chew <yinhoon.chew@mssm.edu>
    :Date: 2018-09-10
    :Copyright: 2018, Karr Lab
    Severity: Major
    Found in wc_kb/eukaryote.py - About 1 day to fix

      Function transform has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
      Open

      def transform(filename, taxon):
          # read
          wb = openpyxl.load_workbook(filename=filename)
      
          # TOC
      Severity: Minor
      Found in migrations/migration_2019_09_20.py - 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

      Function run has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
      Open

          def run(self, core_path,
                  seq_path='', rewrite_seq_path=True, taxon='prokaryote',
                  models=None, ignore_missing_models=None, ignore_extra_models=None, ignore_sheet_order=None,
                  include_all_attributes=False, ignore_missing_attributes=None, ignore_extra_attributes=None, ignore_attribute_order=None,
                  group_objects_by_model=True, validate=True, read_metadata=False):
      Severity: Minor
      Found in wc_kb/io.py - About 7 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

      File io.py has 368 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """ Reading and writing knowledge bases to/from files.
      
      Supported file types:
      
      * Comma separated values (.csv)
      Severity: Minor
      Found in wc_kb/io.py - About 4 hrs to fix

        Function deserialize_side has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            def deserialize_side(self, direction, value, objects, global_comp):
                """ Deserialize the LHS or RHS of a reaction equation
                Args:
                    direction (:obj:`float`): -1. indicates LHS, +1. indicates RHS
                    value (:obj:`str`): String representation
        Severity: Minor
        Found in wc_kb/core.py - About 4 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

        Function transform has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

        def transform(filename, taxon):
            # read
            wb = openpyxl.load_workbook(filename=filename)
        
            for ws in wb:
        Severity: Minor
        Found in migrations/migration_2020_03_09.py - About 4 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

        PROKARYOTE_MODELS = (
            core.KnowledgeBase,
            core.Cell,
            core.Compartment,
            core.DnaSpeciesType,
        Severity: Major
        Found in wc_kb/io.py and 1 other location - About 3 hrs to fix
        wc_kb/io.py on lines 52..72

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

        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

        EUKARYOTE_MODELS = (
            core.KnowledgeBase,
            core.Cell,
            core.Compartment,
            core.DnaSpeciesType,
        Severity: Major
        Found in wc_kb/io.py and 1 other location - About 3 hrs to fix
        wc_kb/io.py on lines 30..50

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

        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

                if self.start < self.end:
                    if self.strand == core.PolymerStrand.positive:
                        return core.PolymerDirection.forward
                    elif self.strand == core.PolymerStrand.negative:
                        return core.PolymerDirection.reverse
        Severity: Major
        Found in wc_kb/prokaryote.py and 1 other location - About 3 hrs to fix
        wc_kb/prokaryote.py on lines 133..139

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

        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