biemond/biemond-orawls

View on GitHub

Showing 131 of 131 total issues

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if Puppet.features.root?
      output = `su #{su_shell} - #{os_user} -c 'ORACLE_HOME=#{oracle_product_home_dir};#{oracle_product_home_dir}/OPatch/opatch #{command} -oh #{oracle_product_home_dir} #{jre_specfied} #{orainst}'`
    else
      output = `export ORACLE_HOME=#{oracle_product_home_dir};#{oracle_product_home_dir}/OPatch/opatch #{command} -oh #{oracle_product_home_dir} #{jre_specfied} #{orainst}`
Severity: Major
Found in lib/puppet/provider/wls_opatch/prefetching.rb and 1 other location - About 1 hr to fix
lib/puppet/provider/wls_rcu/wls_rcu.rb on lines 54..58

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

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

    if Puppet.features.root?
      #output = `su #{su_shell} - #{user} -c 'export JAVA_HOME=#{jdk_home_dir};export TZ=GMT;export LANG=en_US.UTF8;export LC_ALL=en_US.UTF8;export NLS_LANG=american_america;#{statement}'`
      rcu_output = `su #{su_shell} - #{user} -c 'export TZ=GMT;#{oraclehome}/common/bin/wlst.sh #{checkscript} #{jdbcurl} #{syspassword} #{prefix} #{sysuser}'`
    else
      rcu_output = `export TZ=GMT;#{oraclehome}/common/bin/wlst.sh #{checkscript} #{jdbcurl} #{syspassword} #{prefix} #{sysuser}`
Severity: Major
Found in lib/puppet/provider/wls_rcu/wls_rcu.rb and 1 other location - About 1 hr to fix
lib/puppet/provider/wls_opatch/prefetching.rb on lines 31..34

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

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

Method domain_partition_control has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def domain_partition_control(action)
    Puppet.debug "domain_partition action: #{action}"

    name                      = resource[:domain_partition]
    user                      = resource[:os_user]

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  unless osbTargets.nil?
    Facter.add("#{prefix}_domain_#{n}_osb") do
      setcode do
        osbTargets
      end
Severity: Major
Found in lib/facter/orawls.rb and 2 other locations - About 45 mins to fix
lib/facter/orawls.rb on lines 253..263
lib/facter/orawls.rb on lines 268..278

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

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 3 locations. Consider refactoring.
Open

  unless soaTargets.nil?
    Facter.add("#{prefix}_domain_#{n}_soa") do
      setcode do
        soaTargets
      end
Severity: Major
Found in lib/facter/orawls.rb and 2 other locations - About 45 mins to fix
lib/facter/orawls.rb on lines 253..263
lib/facter/orawls.rb on lines 283..293

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

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 3 locations. Consider refactoring.
Open

  unless bpmTargets.nil?
    Facter.add("#{prefix}_domain_#{n}_bpm") do
      setcode do
        bpmTargets
      end
Severity: Major
Found in lib/facter/orawls.rb and 2 other locations - About 45 mins to fix
lib/facter/orawls.rb on lines 268..278
lib/facter/orawls.rb on lines 283..293

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

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

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

      def sync
        event = super()
        # rubocop:disable all
        if property = @resource.property(:enable)
          val = property.retrieve
Severity: Minor
Found in lib/puppet/type/wls_domain_partition_control.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

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

      def sync
        event = super()
        # rubocop:disable all
        if property = @resource.property(:enable)
          val = property.retrieve
Severity: Minor
Found in lib/puppet/type/bsu_patch.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

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

      def sync
        event = super()
        # rubocop:disable all
        if property = @resource.property(:enable)
          val = property.retrieve
Severity: Minor
Found in lib/puppet/type/wls_ohsserver.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

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

      def sync
        event = super()
        # rubocop:disable all
        if property = @resource.property(:enable)
          val = property.retrieve
Severity: Minor
Found in lib/puppet/type/opatch.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

Avoid deeply nested control flow statements.
Open

                  unless osb == 'empty'
                    osb = osb.strip.downcase
                    if osb.include? target
                      log 'osb_cluster_configured return true'
                      return true
Severity: Major
Found in lib/puppet/parser/functions/osb_cluster_configured.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                      unless bam == 'empty'
                        bam = bam.strip.downcase
                        if bam.include? target
                          log 'bam_cluster_configured return true'
                          return true
    Severity: Major
    Found in lib/puppet/parser/functions/bam_cluster_configured.rb - About 45 mins to fix

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

        def self.patches_in_home(oracle_product_home_dir, os_user, orainst_dir)
          kernel = Facter.value(:kernel)
          su_shell = kernel == 'Linux' ? '-s /bin/bash' : ''
          full_command  = "#{oracle_product_home_dir}/OPatch/opatch lsinventory -oh #{oracle_product_home_dir} -invPtrLoc #{orainst_dir}/oraInst.loc"
          if Puppet.features.root?
      Severity: Minor
      Found in lib/puppet/provider/wls_opatch/prefetching.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

      Avoid deeply nested control flow statements.
      Open

                        unless jrf == 'empty'
                          jrf = jrf.strip.downcase
                          if jrf.include? target
                            log 'jrf_cluster_configured return true'
                            return true
      Severity: Major
      Found in lib/puppet/parser/functions/jrf_cluster_configured.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                          unless oim == 'empty'
                            if oim == 'true'
                              log 'oim_configured return true'
                              return true
                            end
        Severity: Major
        Found in lib/puppet/parser/functions/oim_configured.rb - About 45 mins to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          newproperty(:target, :array_matching => :all) do
            include EasyType
          
            desc 'The target name'
          
          
          Severity: Minor
          Found in lib/puppet/type/shared/target.rb and 1 other location - About 45 mins to fix
          lib/puppet/type/shared/virtual_target.rb on lines 1..14

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

          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

          Avoid deeply nested control flow statements.
          Open

                          case type
                          when 'jdbc'
                            jdbc =  lookup_wls_var(prefix + '_' + n.to_s + '_jdbc')
                            unless jdbc == 'empty'
                              return true if jdbc.include? wlsObject
          Severity: Major
          Found in lib/puppet/parser/functions/artifact_exists.rb - About 45 mins to fix

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

                  def sync
                    event = super()
                    # rubocop:disable all
                    if property = @resource.property(:enable)
                      val = property.retrieve
            Severity: Minor
            Found in lib/puppet/type/wls_rcu.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

            Avoid deeply nested control flow statements.
            Open

                              unless soa == 'empty'
                                soa = soa.strip.downcase
                                if soa.include? target
                                  log 'soa_cluster_configured return true'
                                  return true
            Severity: Major
            Found in lib/puppet/parser/functions/soa_cluster_configured.rb - About 45 mins to fix
              Severity
              Category
              Status
              Source
              Language