LucaCappelletti94/ucsc_genomes_downloader

View on GitHub
ucsc_genomes_downloader/genome.py

Summary

Maintainability
D
1 day
Test Coverage

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.
Severity: Minor
Found in ucsc_genomes_downloader/genome.py - About 7 hrs to fix

    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
        --------------
    Severity: Minor
    Found in ucsc_genomes_downloader/genome.py - About 3 hrs to fix

      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"),
      Severity: Minor
      Found in ucsc_genomes_downloader/genome.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 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(
      Severity: Minor
      Found in ucsc_genomes_downloader/genome.py - About 35 mins to fix

        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
                ----------
        Severity: Minor
        Found in ucsc_genomes_downloader/genome.py - About 25 mins 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

        There are no issues that match your filters.

        Category
        Status