lib/fog/vcloud_director/requests/compute/get_execute_query.rb

Summary

Maintainability
F
5 days
Test Coverage

Method all_types has 328 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def all_types
          {:xmlns=>xmlns,
           :xmlns_xsi=>xmlns_xsi,
           :type=>"application/vnd.vmware.vcloud.query.queryList+xml",
           :href=>make_href('query'),
Severity: Major
Found in lib/fog/vcloud_director/requests/compute/get_execute_query.rb - About 1 day to fix

    File get_execute_query.rb has 630 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Fog
      module Compute
        class VcloudDirector
          class Real
            # REST API General queries handler.
    Severity: Major
    Found in lib/fog/vcloud_director/requests/compute/get_execute_query.rb - About 1 day to fix

      Method fetch_items has 216 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def fetch_items(type, opts)
                if opts.key?(:filter) && opts[:filter] =~ /^name==([^;,]+)$/
                  name = $1
                elsif type == 'vAppTemplate' && opts.key?(:filter) &&
                  opts[:filter] =~ /^name==([^;,]+);catalogName==([^;,]+)$/ #TODO also match in other order
      Severity: Major
      Found in lib/fog/vcloud_director/requests/compute/get_execute_query.rb - About 1 day to fix

        Method fetch_items has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

                def fetch_items(type, opts)
                  if opts.key?(:filter) && opts[:filter] =~ /^name==([^;,]+)$/
                    name = $1
                  elsif type == 'vAppTemplate' && opts.key?(:filter) &&
                    opts[:filter] =~ /^name==([^;,]+);catalogName==([^;,]+)$/ #TODO also match in other order
        Severity: Minor
        Found in lib/fog/vcloud_director/requests/compute/get_execute_query.rb - About 6 hrs 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 get_execute_query has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

                def get_execute_query(type=nil, options={})
                  if type.nil?
                    response = request(
                      :expects    => 200,
                      :idempotent => true,
        Severity: Minor
        Found in lib/fog/vcloud_director/requests/compute/get_execute_query.rb - About 3 hrs 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 get_execute_query has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                def get_execute_query(type=nil, options={})
                  unless options[:fields].nil?
                    Fog::Mock.not_implemented("Fields are not yet implemented in get_execute_query Mock for #{type}")
                  end
        
        
        Severity: Minor
        Found in lib/fog/vcloud_director/requests/compute/get_execute_query.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 get_execute_query has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def get_execute_query(type=nil, options={})
                  if type.nil?
                    response = request(
                      :expects    => 200,
                      :idempotent => true,
        Severity: Minor
        Found in lib/fog/vcloud_director/requests/compute/get_execute_query.rb - About 1 hr to fix

          Method get_execute_query has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def get_execute_query(type=nil, options={})
                    unless options[:fields].nil?
                      Fog::Mock.not_implemented("Fields are not yet implemented in get_execute_query Mock for #{type}")
                    end
          
          
          Severity: Minor
          Found in lib/fog/vcloud_director/requests/compute/get_execute_query.rb - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status