microting/eform-sdk-dotnet

View on GitHub
cronjob.py

Summary

Maintainability
A
2 hrs
Test Coverage

Function check_new_nuget_version has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def check_new_nuget_version(package_name):
    # Construct the NuGet package URL
    package_url = f"https://api.nuget.org/v3-flatcontainer/{package_name.lower()}/index.json"
    #print(package_url)
    
Severity: Minor
Found in cronjob.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 create_github_issue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def create_github_issue(package_name, old_version, new_version):
    # GitHub API URLs for creating an issue and adding labels
    create_issue_url = f"https://api.github.com/repos/{GITHUB_REPO_OWNER}/{GITHUB_REPO_NAME}/issues"
    add_labels_url = f"https://api.github.com/repos/{GITHUB_REPO_OWNER}/{GITHUB_REPO_NAME}/issues/{{issue_number}}/labels"
    
Severity: Minor
Found in cronjob.py - About 45 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

There are no issues that match your filters.

Category
Status