ariofrio/oration

View on GitHub

Showing 71 of 71 total issues

Method render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def self.render(source, target, ctx = {})
    target = File.expand_path(target)

    Dir.chdir(source) do
      Dir['**/*'].each do |name|
Severity: Minor
Found in lib/hair.rb - 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

Consider simplifying this complex logical expression.
Open

        if not for_tables:
            string_to_sign += (request.get_header('If-modified-since') or '') + NEW_LINE
            string_to_sign += (request.get_header('If-match') or '') + NEW_LINE
            string_to_sign += (request.get_header('If-none-match') or '') + NEW_LINE
            string_to_sign += (request.get_header('If-unmodified-since') or '') + NEW_LINE
Severity: Major
Found in templates/azure/py/WorkerRole/app/winazurestorage.py - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

            if not for_tables:
                string_to_sign += (request.get_header('If-modified-since') or '') + NEW_LINE
                string_to_sign += (request.get_header('If-match') or '') + NEW_LINE
                string_to_sign += (request.get_header('If-none-match') or '') + NEW_LINE
                string_to_sign += (request.get_header('If-unmodified-since') or '') + NEW_LINE
    Severity: Major
    Found in templates/azure/java/WorkerRole/app/winazurestorage.py - About 40 mins to fix

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

      def _install_req(py_executable, unzip=False, distribute=False,
      Severity: Minor
      Found in templates/azure/java/WorkerRole/virtualenv.py - About 35 mins to fix

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

            def put_blob(self, container_name, blob_name, data, content_type = "", metadata = {}):
        Severity: Minor
        Found in templates/azure/py/WorkerRole/app/winazurestorage.py - About 35 mins to fix

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

              def put_blob(self, container_name, blob_name, data, content_type = "", metadata = {}):
          Severity: Minor
          Found in templates/azure/java/WorkerRole/app/winazurestorage.py - About 35 mins to fix

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

            def _install_req(py_executable, unzip=False, distribute=False,
            Severity: Minor
            Found in templates/azure/py/WorkerRole/virtualenv.py - About 35 mins to fix

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

                  def level_matches(self, level, consumer_level):
                      """
                      >>> l = Logger([])
                      >>> l.level_matches(3, 4)
                      False
              Severity: Minor
              Found in templates/azure/py/WorkerRole/virtualenv.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 level_matches has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def level_matches(self, level, consumer_level):
                      """
                      >>> l = Logger([])
                      >>> l.level_matches(3, 4)
                      False
              Severity: Minor
              Found in templates/azure/java/WorkerRole/virtualenv.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

              Avoid too many return statements within this function.
              Open

                  return Logger.INFO
              Severity: Major
              Found in templates/azure/py/WorkerRole/virtualenv.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return Logger.INFO
                Severity: Major
                Found in templates/azure/java/WorkerRole/virtualenv.py - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language