Showing 15 of 17 total issues
File rspec_html.rb
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "erb"
require "teaspoon/formatter/base"
module Teaspoon
module Formatter
Function Runner
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.Runner = (function() {
function Runner() {
this.url = system.args[1];
this.timeout = parseInt(system.args[2] || 180) * 1000;
Class Base
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
RESERVED_PARAMS = ["body", "instrument"]
attr_accessor :total_count, :run_count, :passes, :pendings, :failures, :errors
Function pageCallbacks
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Runner.prototype.pageCallbacks = function() {
var _this = this;
return {
onError: function(message, trace) {
var started = _this.page.evaluate(function() {
Method setup_framework_tasks
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.setup_framework_tasks(options)
extend Rake::DSL
framework = options[:framework]
framework_name = options[:framework_name]
Method parallelize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def parallelize
threads = []
left_capabilities = capabilities
until left_capabilities.empty?
left_capabilities.pop(max_parallel).each do |desired_capability|
- 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
Function onLoadFinished
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
onLoadFinished: function(status) {
if (_this.start) return;
_this.start = new Date().getTime();
var defined = _this.page.evaluate(function() {
return window.Teaspoon;
Method initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options = nil)
options ||= {}
case options
when Hash then @options = options.symbolize_keys
when String then @options = JSON.parse(options).symbolize_keys
- 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 find_env
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.find_env(override = nil)
override ||= ENV["TEASPOON_ENV"]
env_files = override && !override.empty? ? [override] : standard_environments
env_files.each do |filename|
- 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 setup_framework_tasks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.setup_framework_tasks(options)
extend Rake::DSL
framework = options[:framework]
framework_name = options[:framework_name]
- 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_reports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_reports(&block)
input_path do |input|
results = []
@config.reports.each do |format|
result = generate_report(input, format)
- 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 dep
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.dep(message, category = nil)
return if Teaspoon.configured
if category
return if @dep_notified[category]
@dep_notified[category] = true if category
- 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 override_from_env
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.override_from_env(env)
ENV_OVERRIDES[:boolean].each { |o| override(o, env[o] == "true") if env[o].present? }
ENV_OVERRIDES[:integer].each { |o| override(o, env[o].to_i) if env[o].present? }
ENV_OVERRIDES[:string].each { |o| override(o, env[o]) if env[o].present? }
end
- 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 which
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def which(cmd)
exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
exts.each do |ext|
- 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 check_thresholds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_thresholds(&block)
args = threshold_args
return if args.blank?
input_path do |input|
result, st = Open3.capture2e(@executable, "check-coverage", *args, input.shellescape)
- 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"