KarrLab/datanator

View on GitHub

Showing 791 of 791 total issues

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

            elif (gene_name is None and protein_name is not None and 
                  protein_name != 'Uncharacterized protein'): # record exists in uniprot collection with non-filler protein_name
                self.rna_hl_collection.update_one({'protein_name': protein_name},
                                                  {'$set': {'modified': datetime.datetime.utcnow(),
                                                            'gene_name': gene_name},
datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.py on lines 94..115

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

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

class DeleteFASTQFiles(cement.Controller):

    class Meta:
        label = 'delete-fastq'
        description = "Delete fastq files"
Severity: Major
Found in datanator/data_source/process_rna_seq/command_line_core.py and 1 other location - About 7 hrs to fix
datanator/data_source/process_rna_seq/command_line_core.py on lines 49..65

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

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

class ProcessCDNA(cement.Controller):

    class Meta:
        label = 'process-cdna'
        description = "Process a CDNA file into a kallisto index file and save it to a specified directory"
Severity: Major
Found in datanator/data_source/process_rna_seq/command_line_core.py and 1 other location - About 7 hrs to fix
datanator/data_source/process_rna_seq/command_line_core.py on lines 106..122

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

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

"""
:Author: Jonathan Karr <jonrkarr@gmail.com>
:Author: Yosef Roth <yosefdroth@gmail.com>
:Date: 2017-04-10
:Copyright: 2017, Karr Lab
Severity: Minor
Found in datanator/core/data_model.py - About 7 hrs to fix

    Function parse_content has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

        def parse_content(self, ec_code, ec_data, type, val):
            if type == 'PR':
                match = re.match((
                    r'^#(\d+)#'
                    r'[ \n](.*?)'
    Severity: Minor
    Found in datanator/data_source/brenda/core.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 data_source.py has 480 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    :Author: Jonathan Karr <jonrkarr@gmail.com>
    :Date: 2017-05-08
    :Copyright: 2017, Karr Lab
    :License: MIT
    Severity: Minor
    Found in datanator/core/data_source.py - About 7 hrs to fix

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

          def run(self, raw_filename=None, processed_filename=None, max_entries=None):
              raw_filename = raw_filename or self.RAW_FILENAME
              processed_filename = str(Path(processed_filename).expanduser()) or self.PROCESSED_FILENAME
              max_entries = max_entries or self.MAX_ENTRIES
      
      
      Severity: Minor
      Found in datanator/data_source/brenda/core.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

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

          def __init__(self,
                       MongoDB=None,
                       db=None,
                       collection=None,
                       max_entries=float('inf'),
      datanator/data_source/protein_localization/victoria_insert_archaea.py on lines 8..26
      datanator/data_source/protein_localization/victoria_insert_neg_wo_outer_membrane.py on lines 7..25
      datanator/data_source/protein_localization/victoria_insert_protein_atlas.py on lines 10..28

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 114.

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

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

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

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

      Refactorings

      Further Reading

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

          def __init__(self,
                       MongoDB=None,
                       db=None,
                       collection=None,
                       max_entries=float('inf'),
      datanator/data_source/protein_localization/victoria_insert_archaea.py on lines 8..26
      datanator/data_source/protein_localization/victoria_insert_experimental_protein.py on lines 7..25
      datanator/data_source/protein_localization/victoria_insert_protein_atlas.py on lines 10..28

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 114.

      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

      class ProteinComplexSpecie(ProteinSpecie):
          """ Represents a protein interaction
      
              Attributes:
      
      
      Severity: Major
      Found in datanator/core/data_model.py and 1 other location - About 7 hrs to fix
      datanator/core/data_model.py on lines 617..643

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

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

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

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

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

      Refactorings

      Further Reading

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

          def __init__(self,
                       MongoDB=None,
                       db=None,
                       collection=None,
                       max_entries=float('inf'),
      datanator/data_source/protein_localization/victoria_insert_experimental_protein.py on lines 7..25
      datanator/data_source/protein_localization/victoria_insert_neg_wo_outer_membrane.py on lines 7..25
      datanator/data_source/protein_localization/victoria_insert_protein_atlas.py on lines 10..28

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 114.

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

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

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

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

      Refactorings

      Further Reading

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

          def __init__(self,
                       MongoDB=None,
                       db=None,
                       collection=None,
                       max_entries=float('inf'),
      datanator/data_source/protein_localization/victoria_insert_archaea.py on lines 8..26
      datanator/data_source/protein_localization/victoria_insert_experimental_protein.py on lines 7..25
      datanator/data_source/protein_localization/victoria_insert_neg_wo_outer_membrane.py on lines 7..25

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

      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

      class Reference(obj_tables.core.Model):
          """ Represent a reference for an observation
      
          Attributes:
              title (:obj:`str`): title
      Severity: Major
      Found in datanator/core/data_model.py and 1 other location - About 7 hrs to fix
      datanator/core/data_model.py on lines 269..285

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

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

      from datanator_query_python.util import mongo_util
      from datanator_query_python.config import config
      import copy
      import numpy as np
      import re
      Severity: Minor
      Found in datanator/schema_2/transform.py - About 7 hrs to fix

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

            def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
                        authDB=None, readPreference=None, username=None, password=None,
                        verbose=None, max_entries=None, des_db=None, rna_col=None):
                """Init
                
        datanator/data_source/rna_halflife/doi_10_1016_j_cell_2013_12_026.py on lines 13..36
        datanator/data_source/rna_halflife/doi_10_1038_srep01318.py on lines 12..35
        datanator/data_source/rna_halflife/doi_10_1101_gr_131037_111.py on lines 14..37
        datanator/data_source/rna_halflife/doi_10_1371_journal_pone_0059059.py on lines 15..38

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

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

            def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
                        authDB=None, readPreference=None, username=None, password=None,
                        verbose=None, max_entries=None, des_db=None, rna_col=None):
                """Init
                
        datanator/data_source/rna_halflife/doi_10_1016_j_cell_2013_12_026.py on lines 13..36
        datanator/data_source/rna_halflife/doi_10_1038_srep01318.py on lines 12..35
        datanator/data_source/rna_halflife/doi_10_1093_nar_gkt1150.py on lines 13..36
        datanator/data_source/rna_halflife/doi_10_1101_gr_131037_111.py on lines 14..37

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

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

            def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
                        authDB=None, readPreference=None, username=None, password=None,
                        verbose=None, max_entries=None, des_db=None, rna_col=None):
                """Init
                
        datanator/data_source/rna_halflife/doi_10_1016_j_cell_2013_12_026.py on lines 13..36
        datanator/data_source/rna_halflife/doi_10_1038_srep01318.py on lines 12..35
        datanator/data_source/rna_halflife/doi_10_1093_nar_gkt1150.py on lines 13..36
        datanator/data_source/rna_halflife/doi_10_1371_journal_pone_0059059.py on lines 15..38

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

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

            def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
                        authDB=None, readPreference=None, username=None, password=None,
                        verbose=None, max_entries=None, des_db=None, rna_col=None):
                """Init
                
        datanator/data_source/rna_halflife/doi_10_1038_srep01318.py on lines 12..35
        datanator/data_source/rna_halflife/doi_10_1093_nar_gkt1150.py on lines 13..36
        datanator/data_source/rna_halflife/doi_10_1101_gr_131037_111.py on lines 14..37
        datanator/data_source/rna_halflife/doi_10_1371_journal_pone_0059059.py on lines 15..38

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

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

            def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
                        authDB=None, readPreference=None, username=None, password=None,
                        verbose=None, max_entries=None, des_db=None, rna_col=None):
                """Init
                
        Severity: Major
        Found in datanator/data_source/rna_halflife/doi_10_1038_srep01318.py and 4 other locations - About 7 hrs to fix
        datanator/data_source/rna_halflife/doi_10_1016_j_cell_2013_12_026.py on lines 13..36
        datanator/data_source/rna_halflife/doi_10_1093_nar_gkt1150.py on lines 13..36
        datanator/data_source/rna_halflife/doi_10_1101_gr_131037_111.py on lines 14..37
        datanator/data_source/rna_halflife/doi_10_1371_journal_pone_0059059.py on lines 15..38

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

        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 load_missing_kinetic_law_information_from_tsv_helper has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

            def load_missing_kinetic_law_information_from_tsv_helper(self, tsv):
                """ Update the properties of kinetic laws in the local sqlite database based on content downloaded
                from SABIO in TSV format.
        
                Note: this method is necessary because neither of SABIO's SBML and Excel export methods provide
        Severity: Minor
        Found in datanator/data_source/sabio_rk.py - 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

        Severity
        Category
        Status
        Source
        Language