Showing 72 of 97 total issues
Function _sample_config
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _sample_config(config_spec,cfg_all):
cfg = {}
more_work = False
for k,v in config_spec.items():
if isinstance(v,dict):
- Read upRead up
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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, numClasses=10):
super().__init__()
self.numClasses = numClasses
self.activation = nn.LeakyReLU(0.1)
self.conv1a = nn.Conv2d(3, 96, 3, padding=1)
Function __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, num_targets=10):
super().__init__()
self.numClasses = num_targets
self.activation = nn.LeakyReLU(0.1)
self.conv1a = weight_norm(nn.Conv2d(3, 128, 3, padding=1))
Function __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, numClasses=10):
super().__init__()
self.numClasses = numClasses
self.activation = nn.LeakyReLU(0.1)
self.conv1a = weight_norm(nn.Conv2d(3, 96, 3, padding=1))
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, model, dataloaders, opt_constr=optim.Adam, lr_sched = lambda e: 1,
Function _add_call_item_to_queue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _add_call_item_to_queue(pending_work_items,
work_ids,
call_queue):
"""Fills call_queue with _WorkItems from pending_work_items.
This function never blocks.
- Read upRead up
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 process_user_input
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process_user_input(self,executor):
inp = maybe_get_input()
if inp is None: return
if inp[:4]=="halt":pass
elif inp[:3]=="add":
- Read upRead up
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 argupdated_config
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def argupdated_config(cfg,parser=None, namespace=None):
""" Uses the cfg to generate a parser spec which parses the command line arguments
and outputs the updated config. An existing argparser can be specified."""
# TODO: throw error for clobbered names
flat_cfg = flatten(cfg)
- Read upRead up
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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, groups=1, bias=False):
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1,bias=False):
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,in_channels,out_channels,ksize=3,drop_rate=0,stride=1,gn=False,**kwargs):
Function getLabLoader
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def getLabLoader(trainset, lab_BS, amnt_lab=1, amnt_dev=0, dataseed=0, balanced=True,**kwargs):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, root, split='train', joint_transform=None,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, depth=22, block=Bottleneck,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, block, layers, channels, groups=1, num_targets=1000, downsample='basic'):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, block, layers, channels, groups=1, num_targets=1000, downsample='basic'):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, *args,D=None,opt_constr=None,lr_sched=lambda e:1,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, num_groups, eps=1e-2,n_iter=5,momentum=0.1,sampling_stride=3,debug=False):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,k=64,ksize=7,drop_rate=0,stride=1,gn=False,num_heads=8):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, num_targets=10, depth=28, widen_factor=10, drop_rate=0.3,in_channels=3,initial_stride=1):