Showing 254 of 254 total issues
Function fix_columns
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fix_columns(self, df: pd.DataFrame, preferred_name: str, options: List[str]):
if preferred_name not in df.columns:
for name_col in options:
for variant_fx in [str.lower, str.upper, str.title]:
alt = variant_fx(name_col) # noqa
- 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 categorize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def categorize(self,
row: pd.Series,
size_tolerance: int=0,
move_cutoff:float=1.,
ddG_cutoff:float=0.,
- 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 create_polygon
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_polygon(n=6, radius=1.5,
Function _combine_ops
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def _combine_ops(cls,
Function get_color_origins
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_color_origins(self) -> Dict[str, Dict[int, str]]:
"""
Get for the hits and followup the color of the origin
as seen in show_comparison
:return:
- 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 make_maps
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_maps(cls, target: Chem.Mol, mols: List[Chem.Mol], mode: Optional[Dict[str, Any]] = None) \
-> Dict[str, List[Dict[int, int]]]:
"""
This is basically if someone is using this class outside of Monster
- 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 guess_origins
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def guess_origins(self, mol: Chem.Mol = None, hits: Optional[List[Chem.Mol]] = None):
"""
Given a positioned mol guess its origins...
:param mol:
- 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 make_coordinate_constraints_for_combination
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_coordinate_constraints_for_combination(self):
"""
See also ``cls.make_coordinate_constraints_for_placement``.
This operates based on ``atom.HasProp('_Novel')``, not origins!
:return:
- 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 find_attachment
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def find_attachment(pdb: Chem.Mol, ligand_resn: str) -> Tuple[Union[Chem.Atom, None], Union[Chem.Atom, None]]:
"""
Finds the two atoms in a crosslink bond without looking at LINK record
:param pdb: a rdkit Chem object
- 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 _add_bonds
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _add_bonds(self):
"""
Add bonds from aft to mod, a copy of fore.
Called by combine().
Will add property 'provenance' to bonds, with values 'fore' or 'aft' or 'common' or 'semicommon'.
- 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 _con_embed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _con_embed(self, trial: int = 0) -> None:
slimmed = Chem.RWMol(self.positioned_mol)
keepers = []
unkeepers = []
for atom in slimmed.GetAtoms():
- 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 transmute_FindMCS_parameters
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transmute_FindMCS_parameters(
**mode: Unpack[ExtendedFMCSMode]) -> rdFMCS.MCSParameters: # noqa lowercase not applicable
"""
The function ``rdFMCS.FindMCS`` has two ways of being used.
In one, a series of arguments are passed,
Function get_possible_map
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_possible_map(self,
Consider simplifying this complex logical expression. Open
if dummy_w_dummy and \
zeroth.GetSymbol() == '*' and \
first.GetSymbol() == '*':
distance = 9999
dummy_distance = measure_distance(confs[0].GetAtomPosition(i), confs[1].GetAtomPosition(j))
Consider simplifying this complex logical expression. Open
if len(followup_hetero_neighs) == 1 and len(hit_hetero_neighs) == 1:
followup_old, hit_old = followup_atom, hit_atom
followup_atom = followup_hetero_neighs[0]
hit_atom = hit_hetero_neighs[0]
custom_map[hit_name][hit_atom.GetIdx()] = followup_atom.GetIdx()
Consider simplifying this complex logical expression. Open
if residue is None:
## assuming it is LIG then.
ligand_selector = pyrosetta.rosetta.core.select.residue_selector.ResidueNameSelector()
ligand_selector.set_residue_name3('LIG')
m = self._vector2residues(ligand_selector.apply(self.pose)) # noqa its in Igor_min
Consider simplifying this complex logical expression. Open
if len(mapping) == 0:
return mapping
# Sequence[Tuple[int, int]] (basic)
elif isinstance(mapping, Sequence) and isinstance(mapping[0], tuple) and isinstance(mapping[0][1], int):
return [(b, a) for a, b in mapping]
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function extract_mol
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def extract_mol(cls,
Function display_energy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def display_energy(self,
minimized_mol: Union[Chem.Mol, None],
term: Union[str, Enum]='all',
scorefxn: Optional[pyrosetta.ScoreFunction]=None,
colorMap:str='coolwarm') -> Dict[str, float]:
- 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"