Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

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

def subscribe(request):
    if request.method == "GET":
        subscribers = Subscribers.objects.all().order_by("-pk")
        serializer = SubscribeSerializer(
            subscribers, many=True, context={"request": request}
Severity: Minor
Found in apps/web/views.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 ngOnInit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  ngOnInit() {
    if (this.params['title']) {
      this.title = this.params['title'];
    }
    if (this.params['content']) {
Severity: Minor
Found in frontend_v2/src/app/components/utility/confirm/confirm.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 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 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 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