Showing 840 of 1,637 total issues
Function save
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def save(self, *args, **kwargs):
if self.last_run:
recent_results = list(self.recent_results())
if calculate_debounced_passing(recent_results, self.debounce):
self.calculated_status = Service.CALCULATED_PASSING_STATUS
- 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 minimize_targets
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def minimize_targets(targets):
split = [target.split(".") for target in targets]
prefix_nodes_in_common = 0
for i, nodes in enumerate(itertools.izip(*split)):
- 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 parse_metric
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_metric(metric, mins_to_check=5, utcnow=None):
if utcnow is None:
utcnow = time.time()
ret = {
'num_series_with_data': 0,
- 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 update_shifts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_shifts():
events = get_events()
users = User.objects.filter(is_active=True)
user_lookup = {}
for u in users:
- 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 create_viewset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_viewset(arg_model, arg_fields, arg_read_only_fields=(), no_create=False):
arg_read_only_fields = ('id',) + arg_read_only_fields
for field in arg_read_only_fields:
if field not in arg_fields:
arg_fields = arg_fields + (field,)
- 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
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return s+"px";
Avoid too many return
statements within this function. Open
return 'numeric';
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return sData;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return [l, 1];
Avoid too many return
statements within this function. Open
return this;
Avoid too many return
statements within this function. Open
return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: clrToString};
Avoid too many return
statements within this function. Open
return out;
Avoid too many return
statements within this function. Open
return out;
Avoid too many return
statements within this function. Open
return rgb;