Showing 14 of 16 total issues
File routes.py
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import datetime
import collections
import flask
import flask_login
File __init__.py
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
import dataclasses
import datetime
import collections
import typing
File persons.py
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
import dataclasses
import typing
import collections
import numpy as np
Progress
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Progress:
start: datetime.datetime
end: datetime.datetime
points_timeline: timeline.Timeline
status_timeline: timeline.Timeline
Importer
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Importer(importer.BareboneImporter):
def __init__(self, spec):
super().__init__(spec)
self._import_context = "none"
Function _get_event_from_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _get_event_from_data(self, data_dict, name):
time = datetime.datetime.fromisoformat(data_dict["time"])
ret = data.Event(name, data_dict["quantity"] or None, time)
if "value_before" in data_dict:
ret.value_before = data_dict["value_before"]
- 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 _get_owner_epic_of
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_owner_epic_of(self, assignee, committed):
if not assignee:
assignee = "nobody"
name = f"{PROJECT_NAME}-{assignee}"
if committed:
- 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_events
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process_events(self, events: typing.Iterable[data.Event]):
if not events:
return
events_from_oldest = sorted(events, key=lambda x: x.time)
events_from_newest = events_from_oldest[::-1]
- 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_class_io_with_extension
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _update_class_io_with_extension(self, new_class, original_class, extension):
if original_class not in persistence.LOADERS or original_class not in persistence.LOADERS:
return
for backend, loader in persistence.LOADERS[original_class].items():
- 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 jira_retry_n
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def jira_retry_n(retries, longest_pause, func, * args, ** kwargs):
Function move_consensus_estimate_to_authoritative
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def move_consensus_estimate_to_authoritative(task_name):
form = flask.current_app.get_final_class("AuthoritativeForm")()
if form.validate_on_submit():
if form.i_kid_you_not.data:
pollster_cons = webdata.AuthoritativePollster()
- 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 _accepted
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _accepted(cls, jira_string, item):
resolution = item.get_field("resolution")
resolution_text = ""
if resolution:
resolution_text = resolution.name
- 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 cost_matrix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cost_matrix(self):
ret = np.ones((len(self.persons_potential), len(self.cards_by_name)))
ret *= np.inf
for collab_idx, collab_name in enumerate(self.persons_potential):
for task_idx, task_name in enumerate(self.cards_by_name):
- 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 act_on_global_estimate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def act_on_global_estimate(task_name):
r = routers.PollsterRouter()
form = forms.ConsensusForm()
if form.validate_on_submit():
if form.submit.data and form.i_kid_you_not.data:
- 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"