Showing 187 of 187 total issues
Function create_package
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_package(self, subject, repo, package, licenses=None, vcs_url=None,
Function update_package
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_package(self, subject, repo, package, licenses=None, vcs_url=None,
Function debian_upload
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def debian_upload(self, subject, repo, package, version, remote_file_path, local_file_path,
Identical blocks of code found in 2 locations. Consider refactoring. Open
if "passphrase" in body and len(body.keys()) == 1:
headers = {"X-GPG-PASSPHRASE": passphrase}
body = None
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 43.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function update_package
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update_package(self, subject, repo, package, licenses=None, vcs_url=None,
custom_licenses=None, desc=None, labels=None, website_url=None,
issue_tracker_url=None, github_repo=None, github_release_notes_file=None,
public_download_numbers=None, public_stats=None):
""" Update the information of the specified package.
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if "passphrase" in body and len(body.keys()) == 1:
headers = {"X-GPG-PASSPHRASE": passphrase}
body = None
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 43.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function create_repository
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_repository(self, subject, repo, type, description, private=False, labels=None,
Function create_package
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_package(self, subject, repo, package, licenses=None, vcs_url=None,
custom_licenses=None, desc=None, labels=None, website_url=None,
issue_tracker_url=None, github_repo=None, github_release_notes_file=None,
public_download_numbers=None, public_stats=None):
""" Creates a new package in the specified repo (user has to be an owner of the repo)
- 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 _create_access_key
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _create_access_key(self, request_url, id, url=None, cache_for_secs=None, expiry=None,
white_cidrs=None, black_cidrs=None, api_only=False):
""" Create a new access key identified by an access key id
An access key password will be auto-generated if not specified.
- 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 create_entitlement
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_entitlement(self, subject, repo=None, package=None, version=None,
Function update_entitlement
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_entitlement(self, subject, entitlement_id, repo=None, package=None, version=None,
Function upload_content
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload_content(self, subject, repo, package, version, remote_file_path, local_file_path,
Function update_repository
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_repository(self, subject, repo, business_unit=None, description=None, labels=None,
Function create_version
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_version(self, subject, repo, package, version, description=None,
Function create_entitlement
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_entitlement(self, subject, repo=None, package=None, version=None,
access=None, access_keys=None, path=None, tags=None, product=None):
""" Create an entitlement on the specified scope. Scope can be a product, a repository with
an optional path, a package or a version.
- 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 _create_access_key
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _create_access_key(self, request_url, id, url=None, cache_for_secs=None, expiry=None,
Function create_access_key_org
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_access_key_org(self, org, id, url=None, cache_for_secs=None, expiry=None,
Function create_access_key_user
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_access_key_user(self, user, id, url=None, cache_for_secs=None, expiry=None,
Function update_version
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_version(self, subject, repo, package, version, description=None,
Function create_product
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_product(self, subject, name, display_name, desc, website, vcs, packages,