Cloud-CV/EvalAI

View on GitHub
scripts/workers/remote_submission_worker.py

Summary

Maintainability
D
1 day
Test Coverage

File remote_submission_worker.py has 504 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

Severity: Major
Found in scripts/workers/remote_submission_worker.py - About 1 day to fix

    Function make_request has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def make_request(url, method, data=None):
        headers = get_request_headers()
        if method == "GET":
            try:
                response = requests.get(url=url, headers=headers)
    Severity: Minor
    Found in scripts/workers/remote_submission_worker.py - About 2 hrs 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 main has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def main():
        killer = GracefulKiller()
        logger.info(
            "Using {0} as temp directory to store data".format(BASE_TEMP_DIR)
        )
    Severity: Minor
    Found in scripts/workers/remote_submission_worker.py - About 1 hr 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 run_submission has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def run_submission(
        challenge_pk,
        challenge_phase,
        submission,
        user_annotation_file_path,
    Severity: Minor
    Found in scripts/workers/remote_submission_worker.py - About 1 hr to fix

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

      def run_submission(
      Severity: Minor
      Found in scripts/workers/remote_submission_worker.py - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status