KarrLab/datanator

View on GitHub

Showing 376 of 791 total issues

Function fill_gerosa_collection has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def fill_gerosa_collection(self, file_location, sheet_name='Sheet1', start_row=0,
                                use_columns='A:E,G', column_names=['EC_Number', 'metabolite',
                                'concentration', 'k_m', 'abbreviation', 'species_name'],
                                reference={'doi': '10.1038/nchembio.2077'}, unit='M',
                                nrows=None):

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

    def add_to_halflife(self, df, growth_medium='TMA'):
        """Add df to existing rna_halflife collection
        
        Args:
            df (:obj:`pandas.DataFrame`): dataframe to be added.
Severity: Minor
Found in datanator/data_source/rna_halflife/doi_10_1186_s12864_016_3219_8.py - About 1 hr 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 process_docs has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def process_docs(self, skip=0):
        #read .tsv file
        data=pd.read_csv('Experimental-PSORTdb-v4.00.tsv',delimiter="\t")
        data = data.where(pd.notnull(data), None)
        

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

    def hash_null_reactants(self, start=0):
        """(https://github.com/KarrLab/datanator/issues/50)
           (https://github.com/KarrLab/datanator_rest_api/issues/116)

        Args:
Severity: Minor
Found in datanator/data_source/sabio_reaction.py - About 1 hr 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 _default has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def _default(self):
        # parse input
        def parse_participants(side, coefficient, reaction, errors):
            for participant in side.split(' + '):
                participant = participant.strip()
Severity: Minor
Found in datanator/__main__.py - About 1 hr 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 fill_collection has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def fill_collection(self):
        projection = {'_id': 0,'resource': 1, 'reaction_participant': 1,
                    'reaction_participant': 1, 'kinlaw_id': 1, 'enzymes': 1}
        collection = self.db_obj['sabio_rk_old']
        docs = collection.find({}, projection=projection)
Severity: Minor
Found in datanator/data_source/sabio_reaction.py - About 1 hr 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 parse_psortdb has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_psortdb(self):
        """
        To parse database psortdb Experimental-PSORTdb-v4.00.tsv file
        and create JSON files conforming to datanator_pattern/observation_compiled.json

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

    def many_to_many(self, collection_str1='metabolites_meta',
                     collection_str2='metabolites_meta', field1='inchi',
                     field2='inchi', lookup1='InChI_Key',
                     lookup2='InChI_Key', num=100):
        ''' Go through collection_str and assign each
Severity: Minor
Found in datanator/util/calc_tanimoto.py - About 1 hr 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 __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
Severity: Major
Found in datanator/data_source/rna_halflife/doi_10_1038_srep01318.py - About 1 hr to fix

    Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
    Severity: Major
    Found in datanator/data_source/rna_halflife/doi_10_1186_gb_2012_13_4_r30.py - About 1 hr to fix

      Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
      Severity: Major
      Found in datanator/data_source/rna_halflife/doi_10_1093_nar_gkt1150.py - About 1 hr to fix

        Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
        Severity: Major
        Found in datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.py - About 1 hr to fix

          Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
          Severity: Major
          Found in datanator/data_source/rna_halflife/doi_10_1101_gr_131037_111.py - About 1 hr to fix

            Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,

              Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, cache_dirname=None, MongoDB=None, src_db='datanator',
              Severity: Major
              Found in datanator/data_source/rna_halflife/order_by_ko.py - About 1 hr to fix

                Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
                Severity: Major
                Found in datanator/data_source/rna_halflife/doi_10_1091_mbc_e11_01_0028.py - About 1 hr to fix

                  Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,

                    Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, name=None, cache_dirname=None, clear_content=False, load_content=False, max_entries=float('inf'),
                    Severity: Major
                    Found in datanator/core/data_source.py - About 1 hr to fix

                      Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(self, server=None, username=None, password=None, src_db=None,
                      Severity: Major
                      Found in datanator/util/rna_halflife_util.py - About 1 hr to fix

                        Function load_unreviewed_abundance has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def load_unreviewed_abundance(self):
                                '''
                                    Load abundance info for proteins that are not reviewed in uniprot
                                '''
                                query_uniprot = {'abundances': {'$exists': True}}
                        Severity: Minor
                        Found in datanator/data_source/protein_aggregate.py - About 1 hr 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