xebialabs-community/xlr-xlrelease-plugin

View on GitHub

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)
Severity: Major
Found in src/main/resources/xlr/HttpClient.py and 1 other location - About 2 hrs to fix
src/main/resources/xlr/HttpClient.py on lines 34..37

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

Further Reading

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)
Severity: Major
Found in src/main/resources/xlr/HttpClient.py and 1 other location - About 2 hrs to fix
src/main/resources/xlr/HttpClient.py on lines 29..32

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

Further Reading

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)
Severity: Major
Found in src/main/resources/xlr/HttpClient.py and 1 other location - About 2 hrs to fix
src/main/resources/xlr/HttpClient.py on lines 24..27

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

Further Reading

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)
Severity: Major
Found in src/main/resources/xlr/HttpClient.py and 1 other location - About 2 hrs to fix
src/main/resources/xlr/HttpClient.py on lines 39..42

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

Further Reading

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

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."

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

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."

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

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."

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
Severity: Minor
Found in src/main/resources/xlr/GetTaskId.py by radon

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 :
Severity: Major
Found in src/main/resources/xlr/WaitForBlockingTask.py - About 45 mins to fix

    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:
    Severity: Minor
    Found in src/main/resources/xlr/CreateTemplate.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

    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"] )
    Severity: Major
    Found in src/main/resources/xlr/WaitForBlockingTask.py - About 45 mins to fix

      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(','):
      Severity: Minor
      Found in src/main/resources/xlr/CreateAndStartSubRelease.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

      Severity
      Category
      Status
      Source
      Language