Showing 44 of 173 total issues
Method run
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
def run(params = {})
file(params)
logger.warn 'Test executing locally ...'
cmd = "#{params[:path] ? File.join(params[:path], 'jmeter') : 'jmeter'} #{"-n" unless params[:gui] } -t #{params[:file]} -j #{params[:log] ? params[:log] : 'jmeter.log' } -l #{params[:jtl] ? params[:jtl] : 'jmeter.jtl' } #{build_properties(params[:properties]) if params[:properties]}"
- Read upRead up
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 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'CompositeGraph' : (params[:name] || 'CompositeGraph')
graphNodes = params.collect { |g| "<stringProp name=\"\">#{g[:graph]}</stringProp>"}
metricNodes = params.collect { |m| "<stringProp name=\"\">#{m[:metric]}</stringProp>"}
Method initialize
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'JavaRequest' : (params[:name] || 'JavaRequest')
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
<JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="#{testname}" enabled="true">
<elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
Method initialize
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'JavaRequestDefaults' : (params[:name] || 'JavaRequestDefaults')
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
<JavaConfig guiclass="JavaConfigGui" testclass="JavaConfig" testname="#{testname}" enabled="true">
<elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
Method parse_url
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def parse_url(params)
return if params[:url].empty?
if params[:url] =~ /https?:\/\/\$/ || params[:url][0] == '$'
params[:path] = params[:url] # special case for named expressions
else
- Read upRead up
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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'MailerVisualizer' : (params[:name] || 'MailerVisualizer')
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
<MailerResultCollector guiclass="MailerVisualizer" testclass="MailerResultCollector" testname="#{testname}" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
Method initialize
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'ActiveThreadsOverTime' : (params[:name] || 'ActiveThreadsOverTime')
@doc = Nokogiri::XML(<<-XML.strip_heredoc)
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ThreadsStateOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
Method initialize
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params = {})
@doc = Nokogiri::XML(<<-XML.strip_heredoc)
<kg.apc.jmeter.perfmon.PerfMonCollector guiclass="kg.apc.jmeter.vizualizers.PerfMonGui" testclass="kg.apc.jmeter.perfmon.PerfMonCollector" testname="#{params[:name] || 'PerfmonCollector'}" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
Method flood
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
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))
Method initialize
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'ResponseTimesPercentiles' : (params[:name] || 'ResponseTimesPercentiles')
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesPercentilesGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
<boolProp name="ResultCollector.error_logging">false</boolProp>
Method initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'ResponseTimesOverTime' : (params[:name] || 'ResponseTimesOverTime')
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
<boolProp name="ResultCollector.error_logging">false</boolProp>
Method initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'ResponseTimesDistribution' : (params[:name] || 'ResponseTimesDistribution')
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesDistributionGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
<boolProp name="ResultCollector.error_logging">false</boolProp>
Method initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'ResponseCodesPerSecond' : (params[:name] || 'ResponseCodesPerSecond')
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseCodesPerSecondGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
<boolProp name="ResultCollector.error_logging">false</boolProp>
Method initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'LatenciesOverTime' : (params[:name] || 'LatenciesOverTime')
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.LatenciesOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
<boolProp name="ResultCollector.error_logging">false</boolProp>
Method initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'TransactionsPerSecond' : (params[:name] || 'TransactionsPerSecond')
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.TransactionsPerSecondGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
<boolProp name="ResultCollector.error_logging">false</boolProp>
Method initialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>
Method initialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>
Method initialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params={})
testname = params.kind_of?(Array) ? 'AssertionResults' : (params[:name] || 'AssertionResults')
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
<ResultCollector guiclass="AssertionVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
Method initialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>
Method initialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>