Showing 9 of 11 total issues
Method run
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def run
https ||= config[:https] ? 'https' : 'http'
testurl = "#{https}://#{config[:server]}:#{config[:port]}#{config[:uri]}"
begin
- 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 run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def run
@now = Time.now
critical_jobs = []
jobs = parse_jobs_param
- 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 run
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
https ||= config[:https] ? 'https' : 'http'
testurl = "#{https}://#{config[:server]}:#{config[:port]}#{config[:uri]}"
begin
Method run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run
@start = DateTime.now
@stop = nil
begin
https ||= config[:https] ? 'https' : 'http'
- 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 run
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
@start = DateTime.now
@stop = nil
begin
https ||= config[:https] ? 'https' : 'http'
Method run
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
@now = Time.now
critical_jobs = []
jobs = parse_jobs_param
Method run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run
https ||= config[:https] ? 'https' : 'http'
testurl = "#{https}://#{config[:server]}:#{config[:port]}#{config[:uri]}"
r = if config[:https] && config[:insecure]
- 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 job_status
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def job_status(job_name)
status = jenkins_api_client.job.get_current_build_status(job_name)
# If the job is currently running, get the status of the last build instead
if status == 'running'
build = jenkins_api_client.job.get_build_details(job_name, 'lastCompletedBuild')
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run
begin
https ||= config[:https] ? 'https' : 'http'
r = RestClient::Resource.new("#{https}://#{config[:server]}:#{config[:port]}#{config[:uri]}", timeout: 5).get
all_metrics = ::JSON.parse(r)
- 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"