flood-io/ruby-jmeter

View on GitHub

Showing 44 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) ? 'GraphResults' : (params[:name] || 'GraphResults')
      @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
  <boolProp name="ResultCollector.error_logging">false</boolProp>
Severity: Minor
Found in lib/ruby-jmeter/dsl/graph_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) ? '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) ? '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 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) ? '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) ? '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) ? '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 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 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

                          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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def initialize(name="Loadosophia.org Uploader", params={})
                                params[:error_logging] ||= false;
                                params[:filename] ||= "";
                                params[:project] ||= "DEFAULT";
                                params[:uploadToken] ||= "Invalid Token";
                          Severity: Minor
                          Found in lib/ruby-jmeter/plugins/loadosophia_uploader.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 initialize has a Cognitive Complexity of 8 (exceeds 5 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 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 parse_http_request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def parse_http_request(params)
                                if params[:raw_path]
                                  params[:path] = params[:url]
                                  parse_url(params)
                                else
                          Severity: Minor
                          Found in lib/ruby-jmeter/helpers/parser.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 http_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def http_request(*args, &block)
                                params = args.shift || {}
                                params = { url: params }.merge(args.shift || {}) if params.class == String
                          
                                params[:method] ||= case __callee__.to_s
                          Severity: Minor
                          Found in lib/ruby-jmeter/extend/samplers/http_request.rb - 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

                          Severity
                          Category
                          Status
                          Source
                          Language