DeepRegNet/DeepReg

View on GitHub
deepreg/dataset/loader/interface.py

Summary

Maintainability
C
1 day
Test Coverage

File interface.py has 513 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Interface between the data loaders and file loaders.
"""

from abc import ABC
Severity: Major
Found in deepreg/dataset/loader/interface.py - About 1 day to fix

    Function sample_image_label has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def sample_image_label(
    Severity: Minor
    Found in deepreg/dataset/loader/interface.py - About 45 mins to fix

      Function get_dataset_and_preprocess has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_dataset_and_preprocess(
              self,
              training: bool,
              batch_size: int,
              repeat: bool,
      Severity: Minor
      Found in deepreg/dataset/loader/interface.py - About 45 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

      Function get_dataset_and_preprocess has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def get_dataset_and_preprocess(
      Severity: Minor
      Found in deepreg/dataset/loader/interface.py - About 45 mins to fix

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

            def validate_images_and_labels(
        Severity: Minor
        Found in deepreg/dataset/loader/interface.py - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status