Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

Function get_yaml_files_from_challenge_config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_yaml_files_from_challenge_config(zip_ref):
    """
    Arguments:
        zip_ref {zipfile} -- reference to challenge config zip
    Returns:
Severity: Minor
Found in apps/challenges/challenge_config_utils.py - About 25 mins 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 validate_dates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_dates(self):
        start_date = self.yaml_file_data.get("start_date")
        end_date = self.yaml_file_data.get("end_date")

        if not start_date or not end_date:
Severity: Minor
Found in apps/challenges/challenge_config_utils.py - About 25 mins 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 checkTokenValidity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  checkTokenValidity(err, toast = true) {
    if (err.error !== null && typeof err.error === 'object' && err.error['detail']) {
      if (
        err.error['detail'].indexOf('Invalid token') !== -1 ||
        err.error['detail'].indexOf('Token has expired') !== -1
Severity: Minor
Found in frontend_v2/src/app/services/global.service.ts - About 25 mins 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 isLoggedIn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  isLoggedIn() {
    const token = this.globalService.getAuthToken();
    if (token) {
      if (!this.authState['isLoggedIn']) {
        this.loggedIn(true);
Severity: Minor
Found in frontend_v2/src/app/services/auth.service.ts - About 25 mins 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 updateUserDetails has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  updateUserDetails() {
    const firstName = this.user['first_name'] === '-' ? '' : this.user['first_name'];
    const lastName = this.user['last_name'] === '-' ? '' : this.user['last_name'];
    const affiliation = this.user['affiliation'] === '-' ? '' : this.user['affiliation'];
    const googleScholarUrl = this.user['google_scholar_url'] === '-' ? '' : this.user['google_scholar_url'];
Severity: Minor
Found in frontend_v2/src/app/components/profile/profile.component.ts - About 25 mins 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 downloadSubmission has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  downloadSubmission() {
    if (this.challenge['id'] && this.selectedPhase && this.fileSelected) {
      const API_PATH = this.endpointsService.challengeSubmissionDownloadURL(
        this.challenge['id'],
        this.selectedPhase['id'],

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

Severity
Category
Status
Source
Language