KarrLab/datanator

View on GitHub

Showing 376 of 791 total issues

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

    def __init__(self, cache_dirname=None, MongoDB=None, replicaSet=None, db=None,
Severity: Major
Found in datanator/util/calc_tanimoto.py - About 1 hr to fix

    Function load_content has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def load_content(self):
            """ Collects and Parses all data from Pax DB website and adds to MongoDB
    
            """
            client, db_obj, collection = self.con_db(self.collection)
    Severity: Minor
    Found in datanator/data_source/pax_nosql.py - About 1 hr to fix

      Function fill_collection has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def fill_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'):
              """

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

          def fill_metabolite_fields(self, fields=None, collection_src=None, collection_des = None):
              '''Fill in values of fields of interest from 
                  metabolite collection: ecmdb or ymdb
                      Args:
                              fileds: list of fields of interest
      Severity: Minor
      Found in datanator/data_source/metabolites_meta_collection.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 calc_stats has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def calc_stats(self):
              """ Calculate statistics about SABIO-RK
      
              Returns:
                  :obj:`list` of :obj:`list` of :obj:`obj`: list of list of statistics
      Severity: Minor
      Found in datanator/data_source/sabio_rk.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_kegg_meta has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def fill_kegg_meta(self, start=0):
              """Fill kegg information for reactions.
              
              Args:
                  start (:obj:`int`, optional): Starting document. Defaults to 0.
      Severity: Minor
      Found in datanator/data_source/sabio_rk_json_mongo.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 build_obs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def build_obs(self, data, i, species):
              """Build observation objects from obj.
              Go into observations collection.
              Args:
                  data (:obj:`Obj`): source object.

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

          def build_entity(self, data, i):
              """Build entity object from obj.
              Go into entity collection
      
              Args:

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

          def fill_rna_half_life(self, df, species):
              """Load df into rna_halflife collection
              
              Args:
                  df (:obj:`pandas.DataFrame`): dataframe to be loaded
      Severity: Minor
      Found in datanator/data_source/rna_halflife/doi_10_1093_nar_gkt1150.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 add_inchi_key has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def add_inchi_key(self):
              """Add inchi_key field to sabio_compound collection
              in MongoDB
              """
              query = {}
      Severity: Minor
      Found in datanator/data_source/sabio_compound.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_rna_half_life has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def fill_rna_half_life(self, df, species):
              """Load df into rna_halflife collection
              
              Args:
                  df (:obj:`pandas.DataFrame`): dataframe to be loaded

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

          def fill_uniprot(self, url, sheet_name, usercols='B:D', skiprows=[0,1,2],
                          insertion=True):
              """Fill uniprot colleciton with ordered_locus_name
              from excel sheet
              
      Severity: Minor
      Found in datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, id='', name='', ncbi_id=None, cross_references=None):
              """
              Args:
                  id (:obj:`str`, optional): identifier
                  name (:obj:`str`, optional): name
      Severity: Minor
      Found in datanator/util/taxonomy_util.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_uniprot_with_df has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def fill_uniprot_with_df(self, df, identifier, identifier_type='oln', species=None):
              """Fill uniprot colleciton with ordered_locus_name
              from excel sheet
              
              Args:
      Severity: Minor
      Found in datanator/util/rna_halflife_util.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 flatten_json has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def flatten_json(self, nested_json):
              '''
                  Flatten json object with nested keys into a single level.
                  e.g. 
                  {a: b,                      {a: b,  
      Severity: Minor
      Found in datanator/util/file_util.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 build_obs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def build_obs(self, data, i):
              """Build observation objects from obj.
              Go into observations collection.
              Args:
                  data (:obj:`Obj`): source object.
      Severity: Minor
      Found in datanator/data_source/rna_localization/victoria_parse_LncAtlas.py - About 1 hr to fix

        Function build_obs_s5 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def build_obs_s5(self, data, i, cpt):
                """Build observation objects from obj. (Tables S5) 
                Go into observations collection.
                Args:
                    data (:obj:`Obj`): source object.

          Function fill_gerosa_collection has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def fill_gerosa_collection(self, file_location, sheet_name='Sheet1', start_row=0,

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

                def __init__(self,

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

                  def __init__(self, cache_dirname, MongoDB, db, replicaSet=None, verbose=False, max_entries=float('inf'),
              Severity: Major
              Found in datanator/data_source/kegg_reaction_class.py - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language