mfinzi/pristine-ml

View on GitHub

Showing 72 of 97 total issues

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

def _queue_management_worker(executor_reference,
Severity: Minor
Found in oil/tuning/localGpuExecutor.py - About 45 mins to fix

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

    def conv2d(in_channels,out_channels,kernel_size=3,coords=False,dilation=1,**kwargs):
    Severity: Minor
    Found in oil/architectures/parts/blocks.py - About 45 mins to fix

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

      def make_layers(cfg, batch_norm=False):
          layers = list()
          in_channels = 3
          for v in cfg:
              if v == 'M':
      Severity: Minor
      Found in oil/architectures/img_classifiers/vgg.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 __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, pad_type='reflect', filt_size=3, stride=2, channels=None, pad_off=0):
        Severity: Minor
        Found in oil/architectures/parts/antialiasing.py - About 35 mins to fix

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

              def __init__(self, perform_trial, config_spec={},
          Severity: Minor
          Found in oil/tuning/study.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, pad_type='reflect', filt_size=3, stride=2, channels=None, pad_off=0):
              Severity: Minor
              Found in oil/architectures/parts/antialiasing.py - About 35 mins to fix

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

                    def __init__(self, x_dim, y_dim, with_r, *args, **kwargs):
                Severity: Minor
                Found in oil/architectures/parts/CoordConv.py - About 35 mins to fix

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

                      def _wide_layer(self, block, planes, num_blocks, drop_rate, stride):
                  Severity: Minor
                  Found in oil/architectures/img_classifiers/wide_resnet.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(self, *args, cons_weight=.3, advEps=32, entMin=True, **kwargs):
                      Severity: Minor
                      Found in oil/model_trainers/vat.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(self, in_channels, out_channels, kernel_size, with_r=False, **kwargs):
                          Severity: Minor
                          Found in oil/architectures/parts/CoordConv.py - About 35 mins to fix

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

                                def __init__(self, inplanes,k=16,N=20,drop_rate=0,coords=True):
                            Severity: Minor
                            Found in oil/architectures/parts/blocks.py - About 35 mins to fix

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

                                  def __init__(self, log_dir = None,comment='', no_print=False, ema_com=0, **kwargs):
                              Severity: Minor
                              Found in oil/logging/lazyLogger.py - About 35 mins to fix

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

                                    def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1,bias=True, eps=1e-2, n_iter=5, momentum=0.1, mode=4, num_groups=16,debug=False):
                                        # mode 1: remove channel correlation then pixel correlation
                                        # mode 2: only remove pixel correlation
                                        # mode 3: only channel correlation
                                        # mode 4: remove channel correlation and pixel correlation together
                                Severity: Minor
                                Found in oil/architectures/parts/deconv.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 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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def __init__(self, pad_type='reflect', filt_size=3, stride=2, channels=None, pad_off=0):
                                        super(Downsample, self).__init__()
                                        self.filt_size = filt_size
                                        self.pad_off = pad_off
                                        self.pad_sizes = [int(1.*(filt_size-1)/2), int(np.ceil(1.*(filt_size-1)/2)), int(1.*(filt_size-1)/2), int(np.ceil(1.*(filt_size-1)/2))]
                                Severity: Minor
                                Found in oil/architectures/parts/antialiasing.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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def __init__(self, pad_type='reflect', filt_size=3, stride=2, channels=None, pad_off=0):
                                        super(Downsample1D, self).__init__()
                                        self.filt_size = filt_size
                                        self.pad_off = pad_off
                                        self.pad_sizes = [int(1. * (filt_size - 1) / 2), int(np.ceil(1. * (filt_size - 1) / 2))]
                                Severity: Minor
                                Found in oil/architectures/parts/antialiasing.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