Showing 101 of 190 total issues
File query_protein.py
has 898 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datanator_query_python.util import mongo_util, file_util
from datanator_query_python.query import query_taxon_tree, query_kegg_orthology
from pymongo.collation import Collation, CollationStrength
from pymongo import ASCENDING
from collections import deque
Function inchi_to_inchikey
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def inchi_to_inchikey(self, szINCHISource):
'''
fork from git@github.com:mnowotka/chembl_ikey.git
'''
flagstd = 'S'
- Read upRead up
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 query_taxon_tree.py
has 398 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datanator_query_python.util import mongo_util, chem_util, file_util
from datanator_query_python.aggregate import pipelines
import os
import json
from pymongo.collation import Collation, CollationStrength
File query_sabiork_old.py
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datanator_query_python.util import mongo_util, chem_util, file_util
from datanator_query_python.aggregate import lookups
from pymongo.collation import Collation, CollationStrength
from . import query_taxon_tree, query_sabio_compound
import json
File full_text_search.py
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
from karr_lab_aws_manager.elasticsearch_kl import query_builder as es_query_builder
import numpy as np
import math
import json
import requests
QueryProtein
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class QueryProtein(mongo_util.MongoUtil):
def __init__(self, username=None, password=None, server=None, authSource='admin',
database='datanator', max_entries=float('inf'), verbose=True, collection_str='uniprot',
readPreference='nearest', replicaSet=None):
Function get_kinlawid_by_name
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get_kinlawid_by_name(self, substrates, products):
''' Get kinlaw_id from substrates and products, all in one reaction
Args:
substrates: (:obj:`list` of :obj:`str`): list of substrate names
- Read upRead up
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_router
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def parse_router(self, lines=0):
"""Parse router lines to get API performance values.
Args:
lines(:obj:`int`, optional): Number of lines to parse. If 0, parse all lines.
- Read upRead up
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 get_kinlawid_by_rxn
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_kinlawid_by_rxn(self, substrates, products):
''' Find the kinlaw_id defined in sabio_rk using
rxn participants' inchi string
Args:
- Read upRead up
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 get_equivalent_protein_with_anchor
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_equivalent_protein_with_anchor(self, _id, max_distance, max_depth=float('inf')):
'''
Get replacement abundance value by taxonomic distance
with the same kegg_orthology number.
- Read upRead up
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 get_equivalent_kegg_with_anchor_obsolete
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_equivalent_kegg_with_anchor_obsolete(self, ko, anchor, max_distance, max_depth=float('inf')):
'''
Get replacement abundance value by taxonomic distance
with the same kegg_orthology number.
- Read upRead up
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 get_kinlaw_by_rxn_ortho
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_kinlaw_by_rxn_ortho(self, substrates, products, dof=0,
projection={'kinlaw_id': 1, '_id': 0, "enzymes": 1},
bound='loose', skip=0, limit=0):
''' Find the kinlaw_id defined in sabio_rk using
rxn participants' inchikey
- Read upRead up
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 extract_values
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def extract_values(self, obj, key):
"""Pull all values of specified key from nested JSON.
"""
arr = []
- Read upRead up
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 get_equivalent_protein
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_equivalent_protein(self, _id, max_distance, max_depth=float('inf')):
'''
Get replacement abundance value by taxonomic distance
with the same kegg_orthology number.
- Read upRead up
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 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, cache_dirname=None, MongoDB=None, replicaSet=None, db=None,
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, cache_dirname=None, MongoDB=None, replicaSet=None, db='datanator',
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, cache_dirname=None, MongoDB=None, replicaSet=None, db='datanator',
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, cache_dirname=None, collection_str='taxon_tree',
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, cache_dirname=None, MongoDB=None, replicaSet=None, db='datanator',
Function inchi_to_inchikey
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inchi_to_inchikey(self, szINCHISource):
'''
fork from git@github.com:mnowotka/chembl_ikey.git
'''
flagstd = 'S'