Showing 12 of 12 total issues
File genome.py
has 471 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2019 by
# Luca Cappelletti <luca.cappelletti1@unimi.it>
#
# All rights reserved.
# MIT license.
Function gaps
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def gaps(chrom: str, sequence: str):
i = 0
chromStart = None
chunksize = 500
max_chunk_size = 10000
- 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
Genome
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Genome:
"""Class to automatically retrieve informations and sequences for a Genome from the UCSC Genome Browser assembly database.
Usage examples
--------------
Function __init__
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
assembly: str,
chromosomes: Tuple[str] = None,
filters: Tuple[str] = ("chru", "chrmt", "scaffold", "contig", "super", "chrbin", "random", "hap", "alt", "fix"),
- 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_sequences
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _extract_sequences(
Function extract_sequence
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def extract_sequence(chromosomes: Dict, chrom: str, chromStart: int, chromEnd: int, strand: str, mapping: Dict) -> str:
Function extract_sequences
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def extract_sequences(
Function aligned_tessellate_bed
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def aligned_tessellate_bed(chrom: str, chromStart: int, chromEnd: int, window_size: int, alignment: str) -> pd.DataFrame:
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function download_chromosome
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def download_chromosome(assembly: str, chromosome: str, start: int, end: int, path: str):
Function expand_bed_regions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def expand_bed_regions(bed: pd.DataFrame, window_size: int, alignment: str = "center") -> pd.DataFrame:
"""Return pandas dataframe setting regions to given window size considering given alignment.
Parameters
-----------------------
- 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 filled
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def filled(self, chromosomes: List[str] = None):
"""Return dataframe with BED-like columns with informations on the gaps.
Parameters
----------
- 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"