File config.rb
has 527 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rcs-common/trace'
require_relative 'indexer'
require_relative 'migration'
Method run
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def run(options)
if options[:reset]
reset_pass options
return 0
- 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 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.run!(*argv)
# reopen the class and declare any empty trace method
# if called from command line, we don't have the trace facility
self.class_eval do
def trace(level, message)
Method generate_certificates
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def generate_certificates(options)
trace :info, "Generating ssl certificates..."
# ensure dir is present
FileUtils.mkdir_p File.join($execution_directory, CERT_DIR)
- 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 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(options)
if options[:reset]
reset_pass options
return 0
Class Config
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Config
include Singleton
include Tracer
CONF_DIR = 'config'
Method generate_certificates_anon
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def generate_certificates_anon
trace :info, "Generating anon ssl certificates..."
# ensure dir is present
FileUtils.mkdir_p File.join($execution_directory, CERT_DIR)
- 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 generate_certificates
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_certificates(options)
trace :info, "Generating ssl certificates..."
# ensure dir is present
FileUtils.mkdir_p File.join($execution_directory, CERT_DIR)
Method generate_certificates_anon
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_certificates_anon
trace :info, "Generating anon ssl certificates..."
# ensure dir is present
FileUtils.mkdir_p File.join($execution_directory, CERT_DIR)
Method check_certs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_certs
unless @global['DB_CERT'].nil?
unless File.exist?(Config.instance.cert('DB_CERT'))
trace :fatal, "Cannot open certificate file [#{@global['DB_CERT']}]"
return false
- 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
Avoid too many return
statements within this method. Open
return 0
Avoid too many return
statements within this method. Open
return 0
Avoid too many return
statements within this method. Open
return 0
Avoid too many return
statements within this method. Open
return 0
Avoid too many return
statements within this method. Open
return 0
Method use_pfx_cert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def use_pfx_cert(pfx)
trace :info, "Using pfx cert for windows code signing..."
FileUtils.cp pfx, Config.instance.cert("windows.pfx")
trace :info, "Using pfx cert to create Java Applet keystore..."
- 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"