Showing 15 of 15 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
def post_request(self, context_root, content, additional_headers=None):
request_url = self.url + context_root
return requests.post(request_url, auth=(self.username, self.password), headers=additional_headers,
proxies=self.proxy, verify=self.verify_ssl, data=content)
- 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 60.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
def put_request(self, context_root, content, additional_headers=None):
request_url = self.url + context_root
return requests.put(request_url, auth=(self.username, self.password), headers=additional_headers,
proxies=self.proxy, verify=self.verify_ssl, data=content)
- 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 60.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
def delete_request(self, context_root, additional_headers=None):
request_url = self.url + context_root
return requests.delete(request_url, auth=(self.username, self.password), headers=additional_headers,
proxies=self.proxy, verify=self.verify_ssl)
- 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 56.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
def get_request(self, context_root, additional_headers=None):
request_url = self.url + context_root
return requests.get(request_url, auth=(self.username, self.password), headers=additional_headers,
proxies=self.proxy, verify=self.verify_ssl)
- 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 56.
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
Error: Missing parentheses in call to 'print'. Did you mean print(nt "Http Status: %s" % request.status)? (<unknown>, line 43)</unknown> Open
print "Http Status: %s" % request.status
- Read upRead up
- Exclude checks
We encountered an error attempting to analyze this line.
Error: Missing parentheses in call to 'print'. Did you mean print(int "No server provided.")? (<unknown>, line 34)</unknown> Open
print "No server provided."
- Read upRead up
- Exclude checks
We encountered an error attempting to analyze this line.
Error: Missing parentheses in call to 'print'. Did you mean print(print "Going to use xlr_api_url: ", xlr_api_url)? (<unknown>, line 48)</unknown> Open
print "Going to use xlr_api_url: ", xlr_api_url
- Read upRead up
- Exclude checks
We encountered an error attempting to analyze this line.
Error: Missing parentheses in call to 'print'. Did you mean print(int "No server provided.")? (<unknown>, line 16)</unknown> Open
print "No server provided."
- Read upRead up
- Exclude checks
We encountered an error attempting to analyze this line.
Error: Missing parentheses in call to 'print'. Did you mean print(print "Found matching phase [%s] for deletion.\n" % phase)? (<unknown>, line 32)</unknown> Open
print "Found matching phase [%s] for deletion.\n" % phase
- Read upRead up
- Exclude checks
We encountered an error attempting to analyze this line.
Error: Missing parentheses in call to 'print'. Did you mean print(int "No server provided.")? (<unknown>, line 41)</unknown> Open
print "No server provided."
- Read upRead up
- Exclude checks
We encountered an error attempting to analyze this line.
Error: Missing parentheses in call to 'print'. Did you mean print(int "Received task with title: [%s].\n" % task.title)? (<unknown>, line 19)</unknown> Open
print "Received task with title: [%s].\n" % task.title
- Read upRead up
- Exclude checks
We encountered an error attempting to analyze this line.
Avoid deeply nested control flow statements. Open
if isRunning == True :
break
# End for
if isRunning == True :
Function processTags
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def processTags(tags):
result = ""
if tags is None:
return result
else:
- 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
Avoid deeply nested control flow statements. Open
if phase["title"] == phaseName:
for task in phase["tasks"]:
if task["title"] == taskName :
print ">>>***id = %s, title = %s***" % ( task["id"], task["title"] )
print " Status = %s " % ( task["status"] )
Function process_variables
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_variables(variables, variable_map, updatable_variables):
var_map = {}
result = {}
if variables is not None:
for variable in variables.split(','):
- 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"