biemond/biemond-orawls

View on GitHub
lib/utils/wls_access.rb

Summary

Maintainability
D
2 days
Test Coverage

File wls_access.rb has 306 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'tempfile'
require 'fileutils'
require 'utils/settings'
require 'utils/wls_daemon'

Severity: Minor
Found in lib/utils/wls_access.rb - About 3 hrs to fix

    Method execute_rest has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def execute_rest(domain, parameters, operation)
          array_size = parameters['attributes'].size
    
          weblogicUser       = domain['weblogic_user']     || 'weblogic'
          weblogicConnectUrl = domain['connect_url']       || 'http://localhost:7001'
    Severity: Major
    Found in lib/utils/wls_access.rb - About 2 hrs to fix

      Method controller has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def controller(content, parameters = {})
            action = ''
            unless parameters.nil?
              action = parameters['action']
              Puppet.info "Executing: action #{action}"
      Severity: Minor
      Found in lib/utils/wls_access.rb - About 1 hr to fix

        Method wlst has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def wlst(content, parameters = {})
              script = 'wlstScript'
              action = ''
              unless parameters.nil?
                action = parameters['action']
        Severity: Minor
        Found in lib/utils/wls_access.rb - About 1 hr to fix

          Method execute_wlst has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def execute_wlst(script, tmpFile, parameters, domain, domainValues, options = {})
                operatingSystemUser          = domainValues['user']              || 'oracle'
                weblogicHomeDir              = domainValues['weblogic_home_dir']
                weblogicUser                 = domainValues['weblogic_user']     || 'weblogic'
                weblogicConnectUrl           = domainValues['connect_url']       || 't3://localhost:7001'
          Severity: Minor
          Found in lib/utils/wls_access.rb - About 1 hr to fix

            Method execute_wlst has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                def execute_wlst(script, tmpFile, parameters, domain, domainValues, options = {})
                  operatingSystemUser          = domainValues['user']              || 'oracle'
                  weblogicHomeDir              = domainValues['weblogic_home_dir']
                  weblogicUser                 = domainValues['weblogic_user']     || 'weblogic'
                  weblogicConnectUrl           = domainValues['connect_url']       || 't3://localhost:7001'
            Severity: Minor
            Found in lib/utils/wls_access.rb - About 1 hr 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

            Method controller has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                def controller(content, parameters = {})
                  action = ''
                  unless parameters.nil?
                    action = parameters['action']
                    Puppet.info "Executing: action #{action}"
            Severity: Minor
            Found in lib/utils/wls_access.rb - About 1 hr 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

            Method wlst has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                def wlst(content, parameters = {})
                  script = 'wlstScript'
                  action = ''
                  unless parameters.nil?
                    action = parameters['action']
            Severity: Minor
            Found in lib/utils/wls_access.rb - About 1 hr 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

            Method rest has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def rest(action, domain, domain_values, parameters = {})
                  case action
                  when 'index' then
            
                    all_items = []
            Severity: Minor
            Found in lib/utils/wls_access.rb - About 1 hr to fix

              Method execute_rest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def execute_rest(domain, parameters, operation)
                    array_size = parameters['attributes'].size
              
                    weblogicUser       = domain['weblogic_user']     || 'weblogic'
                    weblogicConnectUrl = domain['connect_url']       || 'http://localhost:7001'
              Severity: Minor
              Found in lib/utils/wls_access.rb - About 1 hr 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

              Method execute_wlst has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def execute_wlst(script, tmpFile, parameters, domain, domainValues, options = {})
              Severity: Minor
              Found in lib/utils/wls_access.rb - About 45 mins to fix

                Method wlst2 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def wlst2(content, action, domain, domain_values, parameters = {})
                Severity: Minor
                Found in lib/utils/wls_access.rb - About 35 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status