LucaCappelletti94/crr_labels

View on GitHub

Showing 9 of 9 total issues

File fantom.py has 338 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from encodeproject import download
from .utils import filter_required_cell_lines, validate_common_parameters, center_window, normalize_cell_lines, normalize_bed_file, load_bed
from typing import List, Dict, Tuple,  Union, Generator
import compress_json
import pandas as pd
Severity: Minor
Found in crr_labels/fantom.py - About 4 hrs to fix

    Function fantom has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def fantom(
        cell_lines: Union[List[str], str],
        window_sizes: Union[List[int], int],
        root: str = "fantom",
        genome: str = "hg38",
    Severity: Minor
    Found in crr_labels/fantom.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 fantom has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def fantom(
    Severity: Major
    Found in crr_labels/fantom.py - About 1 hr to fix

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

      def get_cell_line(
      Severity: Major
      Found in crr_labels/roadmap.py - About 1 hr to fix

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

        def roadmap(
        Severity: Major
        Found in crr_labels/roadmap.py - About 1 hr to fix

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

          def filter_enhancers(
          Severity: Major
          Found in crr_labels/fantom.py - About 1 hr to fix

            Function filter_promoters has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def filter_promoters(
            Severity: Major
            Found in crr_labels/fantom.py - About 50 mins to fix

              Function load_matrix has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def load_matrix(root: str, genome: str, region: str, info: Dict, nrows: int) -> pd.DataFrame:
              Severity: Minor
              Found in crr_labels/fantom.py - About 35 mins to fix

                Function validate_common_parameters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def validate_common_parameters(
                    cell_lines: List[str],
                    window_sizes: List[int],
                    genome: str,
                    info: Dict
                Severity: Minor
                Found in crr_labels/utils/validate_common_parameters.py - About 35 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

                Severity
                Category
                Status
                Source
                Language