xebialabs-community/xlr-bitbucket-plugin

View on GitHub

Showing 7 of 67 total issues

File Stash.py has 443 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2020 XEBIALABS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Severity: Minor
Found in src/main/resources/stash/Stash.py - About 6 hrs to fix

    Function bitbucket_downloadcode has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def bitbucket_downloadcode(self, variables):
            downloadURL = "%s/%s/get/%s.zip" % (
                variables["server"]["url"].replace("api.", "www."),
                variables["repo_full_name"],
                variables["branch"],
    Severity: Minor
    Found in src/main/resources/bitbucket/Bitbucket.py - About 1 hr to fix

      Function stash_downloadcode has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def stash_downloadcode(self, variables):
              downloadURL = (
                  "%s/rest/archive/latest/projects/%s/repos/%s/archive?at=refs/heads/%s&format=zip"
                  % (
                      variables["server"]["url"],
      Severity: Minor
      Found in src/main/resources/stash/Stash.py - About 1 hr to fix

        Function start_pr_release has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def start_pr_release(
        Severity: Major
        Found in src/main/resources/stash/pr_webhook.py - About 1 hr to fix

          Function start_new_branch_release has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def start_new_branch_release(
          Severity: Minor
          Found in src/main/resources/stash/push_webhook.py - About 35 mins to fix

            Function findNewCommit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            def findNewCommit(oldCommitMap, newCommitMap):
                branch = ""
                commitId = ""
            
                # loop over new map branches
            Severity: Minor
            Found in src/main/resources/bitbucket/CommitTrigger.py - About 35 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 findNewCommit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            def findNewCommit(oldCommitMap, newCommitMap):
                branch = None
                commitId = None
            
                # loop over new map branches
            Severity: Minor
            Found in src/main/resources/stash/CommitTrigger.py - About 35 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