Showing 94 of 94 total issues
Class has too many lines. [149/100] Open
class CheckOracleQuery < Sensu::Plugin::Check::CLI
option :username,
description: 'Oracle Username',
short: '-u USERNAME',
long: '--username USERNAME'
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Complex method SensuPluginsOracle::Session::handle_multiple (60.4) Open
def self.handle_multiple(args = {})
# queue with sesssion
queue_sessions = Queue.new
# feed the queue with sessions
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Assignment Branch Condition size for handle_connections_from_file is too high. [28.3/15] Open
def handle_connections_from_file
sessions = ::SensuPluginsOracle::Session.parse_from_file(config[:file],
config[:module])
::SensuPluginsOracle::Session.handle_multiple(sessions: sessions,
method: :query,
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [20/10] Open
def handle_connections_from_file
sessions = ::SensuPluginsOracle::Session.parse_from_file(config[:file],
config[:module])
::SensuPluginsOracle::Session.handle_multiple(sessions: sessions,
method: :query,
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [19/10] Open
def handle_connections_from_file
sessions = ::SensuPluginsOracle::Session.parse_from_file(config[:file])
::SensuPluginsOracle::Session.handle_multiple(sessions: sessions,
method: :alive?,
config: config)
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for handle_connection is too high. [22.38/15] Open
def handle_connection
session = SensuPluginsOracle::Session.new(username: config[:username],
password: config[:password],
database: config[:database],
privilege: config[:privilege],
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Complex method CheckOracleQuery#handle_connections_from_file (45.6) Open
def handle_connections_from_file
sessions = ::SensuPluginsOracle::Session.parse_from_file(config[:file],
config[:module])
::SensuPluginsOracle::Session.handle_multiple(sessions: sessions,
method: :query,
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Assignment Branch Condition size for handle_connections_from_file is too high. [21.4/15] Open
def handle_connections_from_file
sessions = ::SensuPluginsOracle::Session.parse_from_file(config[:file])
::SensuPluginsOracle::Session.handle_multiple(sessions: sessions,
method: :alive?,
config: config)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method handle_multiple
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.handle_multiple(args = {})
# queue with sesssion
queue_sessions = Queue.new
# feed the queue with sessions
- 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 has too many lines. [14/10] Open
def run
# handle OCI8 properties
::SensuPluginsOracle::Session.timeout_properties(config[:timeout])
if config[:version]
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for summary is too high. [19.75/15] Open
def summary(results, session_count)
# header
method = :ok
headers = ["Total: #{session_count}"]
messages = []
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [12/10] Open
def summary(results, session_count)
# header
method = :ok
headers = ["Total: #{session_count}"]
messages = []
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [11/10] Open
def handle_connection
session = SensuPluginsOracle::Session.new(username: config[:username],
password: config[:password],
database: config[:database],
privilege: config[:privilege],
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for handle_connection is too high. [15.07/15] Open
def handle_connection
session = SensuPluginsOracle::Session.new(username: config[:username],
password: config[:password],
database: config[:database],
privilege: config[:privilege])
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Complex method CheckOracleQuery#handle_connection (33.5) Open
def handle_connection
session = SensuPluginsOracle::Session.new(username: config[:username],
password: config[:password],
database: config[:database],
privilege: config[:privilege],
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method CheckOracleAlive#handle_connections_from_file (31.8) Open
def handle_connections_from_file
sessions = ::SensuPluginsOracle::Session.parse_from_file(config[:file])
::SensuPluginsOracle::Session.handle_multiple(sessions: sessions,
method: :alive?,
config: config)
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method CheckOracleQuery#summary (28.2) Open
def summary(results, session_count)
# header
method = :ok
headers = ["Total: #{session_count}"]
messages = []
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Block has too many lines. [29/25] Open
Gem::Specification.new do |s|
s.authors = ["Sensu-Plugins and contributors"]
s.description = "This plugin provides native Oracle instrumentation."
s.email = "<thomas.steiner@ikey.ch>"
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Method handle_connections_from_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def handle_connections_from_file
sessions = ::SensuPluginsOracle::Session.parse_from_file(config[:file])
::SensuPluginsOracle::Session.handle_multiple(sessions: sessions,
method: :alive?,
config: config)
- 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
Complex method CheckOracleAlive#handle_connection (20.3) Open
def handle_connection
session = SensuPluginsOracle::Session.new(username: config[:username],
password: config[:password],
database: config[:database],
privilege: config[:privilege])
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool