KarrLab/wc_model_gen

View on GitHub

Showing 341 of 341 total issues

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

    if test_producibles:
        reactants = test_producibles
    else:    
        reactants = []
        for reaction in submodel.dfba_obj.expression.reactions:
Severity: Major
Found in wc_model_gen/utils.py and 1 other location - About 2 hrs to fix
wc_model_gen/utils.py on lines 86..93

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

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 test_recyclables:
        products = test_recyclables
    else:    
        products = []
        for reaction in submodel.dfba_obj.expression.reactions:
Severity: Major
Found in wc_model_gen/utils.py and 1 other location - About 2 hrs to fix
wc_model_gen/utils.py on lines 77..84

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

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

                            model_rxn = model.reactions.create(
                                submodel=self.submodel,
                                id='{}_dissociation_in_{}_degrade_{}'.format(
                                    compl.id, compl_compartment.id, compl_subunit.species_type.id),
                                name='Dissociation of {} in {} and degradation of {}'.format(
Severity: Major
Found in wc_model_gen/eukaryote/complexation.py and 1 other location - About 2 hrs to fix
wc_model_gen/eukaryote/complexation.py on lines 239..244

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

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

                            model_rxn = model.reactions.create(
                                submodel=self.submodel,
                                id='{}_dissociation_in_{}_degrade_{}'.format(
                                    compl.id, compl_compartment.id, compl_subunit.species_type.id),
                                name='Dissociation of {} in {} and degradation of {}'.format(
Severity: Major
Found in wc_model_gen/eukaryote/complexation.py and 1 other location - About 2 hrs to fix
wc_model_gen/eukaryote/complexation.py on lines 154..159

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

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

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

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

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

Refactorings

Further Reading

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

                if protein_kb.transcript.gene.id in selenoproteome:
                    processed_seq = raw_seq[:-1] if raw_seq.endswith('*') else raw_seq
                    protein_seq = ''.join(i if i!='*' else 'U' for i in processed_seq)
Severity: Major
Found in wc_model_gen/eukaryote/protein_degradation.py and 2 other locations - About 2 hrs to fix
wc_model_gen/eukaryote/complexation.py on lines 191..193
wc_model_gen/eukaryote/translation_translocation.py on lines 292..294

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

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

        if not numpy.isnan(median_init_kcat): 
            for model_kcat in undetermined_init_kcat:
                model_kcat.value = median_init_kcat
                model_kcat.comments = 'Set to the median value because it could not be determined from data'
        else:
Severity: Major
Found in wc_model_gen/eukaryote/translation_translocation.py and 2 other locations - About 2 hrs to fix
wc_model_gen/eukaryote/translation_translocation.py on lines 1344..1351
wc_model_gen/eukaryote/translation_translocation.py on lines 1354..1361

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

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

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

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

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

Refactorings

Further Reading

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

                if mrna_kb.gene.id in selenoproteome:
                    processed_seq = raw_seq[:-1] if raw_seq.endswith('*') else raw_seq
                    protein_seq = ''.join(i if i!='*' else 'U' for i in processed_seq)
Severity: Major
Found in wc_model_gen/eukaryote/translation_translocation.py and 2 other locations - About 2 hrs to fix
wc_model_gen/eukaryote/complexation.py on lines 191..193
wc_model_gen/eukaryote/protein_degradation.py on lines 99..101

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

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 tf_model and tf.direction == wc_kb.eukaryote.RegulatoryDirection.activation:                        
                        F_act, species_act, param_act, func_act = utils.simple_activator(
                            model, reaction_id, tf_model)
                        F_regs.append(F_act)
                        reg_species.update(species_act)
Severity: Major
Found in wc_model_gen/eukaryote/transcription.py and 1 other location - About 2 hrs to fix
wc_model_gen/eukaryote/transcription.py on lines 909..915

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

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

                    elif tf_model and tf.direction == wc_kb.eukaryote.RegulatoryDirection.repression:
                        F_rep, species_rep, param_rep, func_rep = utils.simple_repressor(
                            model, reaction_id, tf_model) 
                        F_regs.append(F_rep)
                        reg_species.update(species_rep)
Severity: Major
Found in wc_model_gen/eukaryote/transcription.py and 1 other location - About 2 hrs to fix
wc_model_gen/eukaryote/transcription.py on lines 901..907

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

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

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

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

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

Refactorings

Further Reading

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

                                        if subunit.species_type.transcript.gene.id in selenoproteome:
                                            processed_seq = raw_seq[:-1] if raw_seq.endswith('*') else raw_seq
                                            protein_seq = ''.join(i if i!='*' else 'U' for i in processed_seq)
Severity: Major
Found in wc_model_gen/eukaryote/complexation.py and 2 other locations - About 2 hrs to fix
wc_model_gen/eukaryote/protein_degradation.py on lines 99..101
wc_model_gen/eukaryote/translation_translocation.py on lines 292..294

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

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

        if not numpy.isnan(median_transloc_kcat):
            for model_kcat in undetermined_transloc_kcat:
                model_kcat.value = median_transloc_kcat
                model_kcat.comments = 'Set to the median value because it could not be determined from data'
        else:
Severity: Major
Found in wc_model_gen/eukaryote/translation_translocation.py and 2 other locations - About 2 hrs to fix
wc_model_gen/eukaryote/translation_translocation.py on lines 1334..1341
wc_model_gen/eukaryote/translation_translocation.py on lines 1344..1351

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

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

        if not numpy.isnan(median_el_kcat):
            for model_kcat in undetermined_el_kcat:
                model_kcat.value = median_el_kcat
                model_kcat.comments = 'Set to the median value because it could not be determined from data'
        else:
Severity: Major
Found in wc_model_gen/eukaryote/translation_translocation.py and 2 other locations - About 2 hrs to fix
wc_model_gen/eukaryote/translation_translocation.py on lines 1334..1341
wc_model_gen/eukaryote/translation_translocation.py on lines 1354..1361

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

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

    def gen_reactions(self):
        """ Generate reactions associated with submodel 
        
        Exchange reactions for components in the media will be be created if they do 
        not exist. The maximum and minimum flux bounds for exchange reactions will also be set.
Severity: Major
Found in wc_model_gen/eukaryote/metabolism.py - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                            if codon == 'ATG':
                                aa = model.species_types.get_one(id='met').species.get_one(compartment=cytosol)
                            elif codon == 'ACT' or codon == 'ACC' or codon == 'ACA' or codon == 'ACG':
                                aa = model.species_types.get_one(id='thr').species.get_one(compartment=cytosol)
                            elif codon == 'ATT' or codon == 'ATC' or codon == 'ATA':
    Severity: Critical
    Found in wc_model_gen/prokaryote/translation.py - About 2 hrs to fix

      Function gen_reactions has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def gen_reactions(self):
              """ Generate reactions assocated with min model
      
              Raises:
                  :obj:`ValueError:` if any phosphate species are missing from the model
      Severity: Minor
      Found in wc_model_gen/prokaryote/metabolism.py - About 2 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 5 locations. Consider refactoring.
      Open

                  reaction.participants.append(metabolites['ppi'][
                      transcription_compartment.id].species_coefficients.get_or_create(
                      coefficient=pre_rna_count['len']-pre_rna_count['N']))
      Severity: Major
      Found in wc_model_gen/eukaryote/transcription.py and 4 other locations - About 2 hrs to fix
      wc_model_gen/eukaryote/transcription.py on lines 529..531
      wc_model_gen/eukaryote/transcription.py on lines 532..534
      wc_model_gen/eukaryote/transcription.py on lines 535..537
      wc_model_gen/eukaryote/transcription.py on lines 538..540

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

      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

                  reaction.participants.append(metabolites['cmp'][
                      transcription_compartment.id].species_coefficients.get_or_create(
                      coefficient=pre_rna_count['C']-ntp_count['C']))
      Severity: Major
      Found in wc_model_gen/eukaryote/transcription.py and 4 other locations - About 2 hrs to fix
      wc_model_gen/eukaryote/transcription.py on lines 526..528
      wc_model_gen/eukaryote/transcription.py on lines 529..531
      wc_model_gen/eukaryote/transcription.py on lines 535..537
      wc_model_gen/eukaryote/transcription.py on lines 538..540

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

      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

                          eval_rate_law = reaction.rate_laws[0].expression._parsed_expression.eval({
                              wc_lang.Species: mito_species_counts,
                              wc_lang.Compartment: {
                                  mitochondria.id: mitochondria.init_volume.mean * \
                                      mitochondria.init_density.value}
      Severity: Major
      Found in wc_model_gen/eukaryote/translation_translocation.py and 2 other locations - About 2 hrs to fix
      wc_model_gen/eukaryote/transcription.py on lines 1258..1262
      wc_model_gen/eukaryote/translation_translocation.py on lines 1528..1532

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

      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

                  reaction.participants.append(metabolites['gmp'][
                      transcription_compartment.id].species_coefficients.get_or_create(
                      coefficient=pre_rna_count['G']-ntp_count['G']))
      Severity: Major
      Found in wc_model_gen/eukaryote/transcription.py and 4 other locations - About 2 hrs to fix
      wc_model_gen/eukaryote/transcription.py on lines 526..528
      wc_model_gen/eukaryote/transcription.py on lines 529..531
      wc_model_gen/eukaryote/transcription.py on lines 532..534
      wc_model_gen/eukaryote/transcription.py on lines 538..540

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

      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

                  reaction.participants.append(metabolites['ump'][
                      transcription_compartment.id].species_coefficients.get_or_create(
                      coefficient=pre_rna_count['U']-ntp_count['U']))
      Severity: Major
      Found in wc_model_gen/eukaryote/transcription.py and 4 other locations - About 2 hrs to fix
      wc_model_gen/eukaryote/transcription.py on lines 526..528
      wc_model_gen/eukaryote/transcription.py on lines 529..531
      wc_model_gen/eukaryote/transcription.py on lines 532..534
      wc_model_gen/eukaryote/transcription.py on lines 535..537

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

      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