mfinzi/pristine-ml

View on GitHub
oil/architectures/img_classifiers/shake_shake.py

Summary

Maintainability
B
5 hrs
Test Coverage

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

    def __init__(self, block, layers, channels, groups=1, num_targets=1000, downsample='basic'):
Severity: Minor
Found in oil/architectures/img_classifiers/shake_shake.py - About 45 mins to fix

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

        def __init__(self, block, layers, channels, groups=1, num_targets=1000, downsample='basic'):
    Severity: Minor
    Found in oil/architectures/img_classifiers/shake_shake.py - About 45 mins to fix

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

          def __init__(self, inplanes, planes, groups, stride=1, downsample=None):
      Severity: Minor
      Found in oil/architectures/img_classifiers/shake_shake.py - About 35 mins to fix

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

            def __init__(self, inplanes, planes, groups, stride=1, downsample=None):
        Severity: Minor
        Found in oil/architectures/img_classifiers/shake_shake.py - About 35 mins to fix

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

              def _make_layer(self, block, planes, groups, blocks, stride=1):
          Severity: Minor
          Found in oil/architectures/img_classifiers/shake_shake.py - About 35 mins to fix

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

                def _make_layer(self, block, planes, groups, blocks, stride=1):
            Severity: Minor
            Found in oil/architectures/img_classifiers/shake_shake.py - About 35 mins to fix

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

                  def _make_layer(self, block, planes, groups, blocks, stride=1):
                      downsample = None
                      if stride != 1 or self.inplanes != block.out_channels(planes, groups):
                          if self.downsample_mode == 'basic' or stride == 1:
                              downsample = nn.Sequential(
              Severity: Minor
              Found in oil/architectures/img_classifiers/shake_shake.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

              Function _make_layer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _make_layer(self, block, planes, groups, blocks, stride=1):
                      downsample = None
                      if stride != 1 or self.inplanes != block.out_channels(planes, groups):
                          if self.downsample_mode == 'basic' or stride == 1:
                              downsample = nn.Sequential(
              Severity: Minor
              Found in oil/architectures/img_classifiers/shake_shake.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