scripts/workers/remote_submission_worker.py
File remote_submission_worker.py
has 504 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
Function make_request
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
def make_request(url, method, data=None):
headers = get_request_headers()
if method == "GET":
try:
response = requests.get(url=url, headers=headers)
- 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 main
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def main():
killer = GracefulKiller()
logger.info(
"Using {0} as temp directory to store data".format(BASE_TEMP_DIR)
)
- 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 run_submission
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run_submission(
challenge_pk,
challenge_phase,
submission,
user_annotation_file_path,
Function run_submission
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def run_submission(