Showing 6 of 49 total issues
Method binary_checksum
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.binary_checksum(node, resource)
tag = node['kernel']['machine'] =~ /x86_64/ ? 'amd64' : '386'
case [node['os'], tag].join('-')
when 'darwin-i386'
case resource.version
Method binary_checksum
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.binary_checksum(node, resource)
tag = node['kernel']['machine'] =~ /x86_64/ ? 'amd64' : '386'
case [node['os'], tag].join('-')
when 'darwin-i386'
case resource.version
- 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
File consul_template_installation_binary.rb
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'poise'
require_relative './helpers'
require_relative './nssm_helpers'
module ConsulTemplateCookbook
Method action_enable
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def action_enable
notifying_block do
directories = %W(#{new_resource.data_dir}
#{::File.dirname(new_resource.nssm_params['AppStdout'])}
#{::File.dirname(new_resource.nssm_params['AppStderr'])}).uniq.compact
Method nssm_params
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def nssm_params
%w(Application
AppParameters
AppDirectory
AppExit
Method action_enable
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def action_enable
notifying_block do
directories = %W(#{new_resource.data_dir}
#{::File.dirname(new_resource.nssm_params['AppStdout'])}
#{::File.dirname(new_resource.nssm_params['AppStderr'])}).uniq.compact
- 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"