flood-io/ruby-jmeter

View on GitHub

Showing 173 of 173 total issues

Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def initialize(params={})
      testname = params.kind_of?(Array) ? 'SplineVisualizer' : (params[:name] || 'SplineVisualizer')
      @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
<ResultCollector guiclass="SplineVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
  <boolProp name="ResultCollector.error_logging">false</boolProp>
Severity: Minor
Found in lib/ruby-jmeter/dsl/spline_visualizer.rb - About 1 hr to fix

    Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def initialize(params={})
          testname = params.kind_of?(Array) ? 'ComparisonAssertionVisualizer' : (params[:name] || 'ComparisonAssertionVisualizer')
          @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
    <ResultCollector guiclass="ComparisonVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
      <boolProp name="ResultCollector.error_logging">false</boolProp>
    Severity: Minor
    Found in lib/ruby-jmeter/dsl/comparison_assertion_visualizer.rb - About 1 hr to fix

      Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def initialize(params={})
            testname = params.kind_of?(Array) ? 'ViewResultsTree' : (params[:name] || 'ViewResultsTree')
            @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
      <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
        <boolProp name="ResultCollector.error_logging">false</boolProp>
      Severity: Minor
      Found in lib/ruby-jmeter/dsl/view_results_tree.rb - About 1 hr to fix

        Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def initialize(params={})
              testname = params.kind_of?(Array) ? 'ResponseTimeGraph' : (params[:name] || 'ResponseTimeGraph')
              @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
        <ResultCollector guiclass="RespTimeGraphVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
          <boolProp name="ResultCollector.error_logging">false</boolProp>
        Severity: Minor
        Found in lib/ruby-jmeter/dsl/response_time_graph.rb - About 1 hr to fix

          Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def initialize(params={})
                testname = params.kind_of?(Array) ? 'SimpleDataWriter' : (params[:name] || 'SimpleDataWriter')
                @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
          <ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="#{testname}" enabled="true">
            <boolProp name="ResultCollector.error_logging">false</boolProp>
          Severity: Minor
          Found in lib/ruby-jmeter/dsl/simple_data_writer.rb - About 1 hr to fix

            Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def initialize(params={})
                  testname = params.kind_of?(Array) ? 'SummaryReport' : (params[:name] || 'SummaryReport')
                  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
            <ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="#{testname}" enabled="true">
              <boolProp name="ResultCollector.error_logging">false</boolProp>
            Severity: Minor
            Found in lib/ruby-jmeter/dsl/summary_report.rb - About 1 hr to fix

              Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def initialize(params={})
                    testname = params.kind_of?(Array) ? 'DistributionGraphalpha' : (params[:name] || 'DistributionGraphalpha')
                    @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
              <ResultCollector guiclass="DistributionGraphVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
                <boolProp name="ResultCollector.error_logging">false</boolProp>
              Severity: Minor
              Found in lib/ruby-jmeter/dsl/distribution_graphalpha.rb - About 1 hr to fix

                Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def initialize(params={})
                      testname = params.kind_of?(Array) ? 'MonitorResults' : (params[:name] || 'MonitorResults')
                      @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
                <ResultCollector guiclass="MonitorHealthVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
                  <boolProp name="ResultCollector.error_logging">false</boolProp>
                Severity: Minor
                Found in lib/ruby-jmeter/dsl/monitor_results.rb - About 1 hr to fix

                  Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def initialize(params={})
                        testname = params.kind_of?(Array) ? 'ViewResultsInTable' : (params[:name] || 'ViewResultsInTable')
                        @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
                  <ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
                    <boolProp name="ResultCollector.error_logging">false</boolProp>
                  Severity: Minor
                  Found in lib/ruby-jmeter/dsl/view_results_in_table.rb - About 1 hr to fix

                    Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def initialize(params={})
                          testname = params.kind_of?(Array) ? 'AggregateGraph' : (params[:name] || 'AggregateGraph')
                          @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
                    <ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
                      <boolProp name="ResultCollector.error_logging">false</boolProp>
                    Severity: Minor
                    Found in lib/ruby-jmeter/dsl/aggregate_graph.rb - About 1 hr to fix

                      Method initialize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def initialize(params={})
                            testname = params.kind_of?(Array) ? 'SmtpSampler' : (params[:name] || 'SmtpSampler')
                            @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
                      <SmtpSampler guiclass="SmtpSamplerGui" testclass="SmtpSampler" testname="#{testname}" enabled="true">
                        <stringProp name="SMTPSampler.server"/>
                      Severity: Minor
                      Found in lib/ruby-jmeter/dsl/smtp_sampler.rb - About 1 hr to fix

                        Method http_request_defaults has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def http_request_defaults(params = {}, &block)
                              params[:image_parser] = true if params.keys.include? :download_resources
                              params[:concurrentDwn] = true if params.keys.include? :use_concurrent_pool
                              params[:concurrentPool] = params[:use_concurrent_pool] if params.keys.include? :use_concurrent_pool
                        
                        
                        Severity: Minor
                        Found in lib/ruby-jmeter/extend/config_elements/http_request_defaults.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 initialize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def initialize(params={})
                                testname = params.kind_of?(Array) ? 'Redis Data Set Config' : (params[:name] || 'Redis Data Set Config')
                                params[:getMode] ||= "1" unless params[:remove] == true
                                @doc = Nokogiri::XML(<<-XML.strip_heredoc)
                                  <kg.apc.jmeter.config.redis.RedisDataSet guiclass="TestBeanGUI" testclass="kg.apc.jmeter.config.redis.RedisDataSet" testname="#{testname}" enabled="true">
                        Severity: Minor
                        Found in lib/ruby-jmeter/plugins/redis_data_set.rb - About 1 hr to fix

                          Method http_request_defaults has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def http_request_defaults(params = {}, &block)
                                params[:image_parser] = true if params.keys.include? :download_resources
                                params[:concurrentDwn] = true if params.keys.include? :use_concurrent_pool
                                params[:concurrentPool] = params[:use_concurrent_pool] if params.keys.include? :use_concurrent_pool
                          
                          
                          Severity: Minor
                          Found in lib/ruby-jmeter/extend/config_elements/http_request_defaults.rb - About 1 hr to fix

                            Method initialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def initialize(params={})
                                  testname = params.kind_of?(Array) ? 'JmsPublisher' : (params[:name] || 'JmsPublisher')
                                  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
                            <PublisherSampler guiclass="JMSPublisherGui" testclass="PublisherSampler" testname="#{testname}" enabled="true">
                              <stringProp name="jms.jndi_properties">false</stringProp>
                            Severity: Minor
                            Found in lib/ruby-jmeter/dsl/jms_publisher.rb - About 1 hr to fix

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

                                  def update_collection(params)
                                    elements = @doc.at_xpath("//collectionProp/elementProp")
                                    params.each_with_index do |param, index|
                                      param.each do |name, value|
                                        next unless elements && elements.element_children
                              Severity: Minor
                              Found in lib/ruby-jmeter/helpers/helper.rb - About 55 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 flood has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def flood(token, params = {})
                                    RestClient.proxy = params[:proxy] if params[:proxy]
                                    begin
                                      file = Tempfile.new(['ruby-jmeter', '.jmx'])
                                      file.write(doc.to_xml(indent: 2))
                              Severity: Minor
                              Found in lib/ruby-jmeter/extend/misc/flood.rb - About 55 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 rsync has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def rsync(params = {})
                                    logger.warn "Test file upload via rsync ..."
                              
                                    file(params)
                              
                              
                              Severity: Minor
                              Found in lib/ruby-jmeter/extend/misc/rsync.rb - About 55 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

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

                                class Ajp13Sampler
                                  attr_accessor :doc
                                  include Helper
                              
                                  def initialize(params={})
                              Severity: Major
                              Found in lib/ruby-jmeter/dsl/ajp13_sampler.rb and 8 other locations - About 50 mins to fix
                              lib/ruby-jmeter/dsl/http_request.rb on lines 9..38
                              lib/ruby-jmeter/dsl/http_request_defaults.rb on lines 9..38
                              lib/ruby-jmeter/dsl/jms_pointtopoint.rb on lines 9..38
                              lib/ruby-jmeter/dsl/ldap_request.rb on lines 9..32
                              lib/ruby-jmeter/dsl/ldap_request_defaults.rb on lines 9..36
                              lib/ruby-jmeter/dsl/setup_thread_group.rb on lines 9..33
                              lib/ruby-jmeter/dsl/test_plan.rb on lines 9..28
                              lib/ruby-jmeter/dsl/thread_group.rb on lines 9..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 43.

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

                                class LdapRequest
                                  attr_accessor :doc
                                  include Helper
                              
                                  def initialize(params={})
                              Severity: Major
                              Found in lib/ruby-jmeter/dsl/ldap_request.rb and 8 other locations - About 50 mins to fix
                              lib/ruby-jmeter/dsl/ajp13_sampler.rb on lines 9..38
                              lib/ruby-jmeter/dsl/http_request.rb on lines 9..38
                              lib/ruby-jmeter/dsl/http_request_defaults.rb on lines 9..38
                              lib/ruby-jmeter/dsl/jms_pointtopoint.rb on lines 9..38
                              lib/ruby-jmeter/dsl/ldap_request_defaults.rb on lines 9..36
                              lib/ruby-jmeter/dsl/setup_thread_group.rb on lines 9..33
                              lib/ruby-jmeter/dsl/test_plan.rb on lines 9..28
                              lib/ruby-jmeter/dsl/thread_group.rb on lines 9..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 43.

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language