jejacks0n/teaspoon

View on GitHub

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
Severity: Minor
Found in lib/teaspoon/formatter/rspec_html.rb - About 4 hrs to fix

    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;
    Severity: Major
    Found in lib/teaspoon/driver/phantomjs/runner.js - About 4 hrs to fix

      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
      
      
      Severity: Minor
      Found in lib/teaspoon/formatter/base.rb - About 4 hrs to fix

        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() {
        Severity: Major
        Found in lib/teaspoon/driver/phantomjs/runner.js - About 2 hrs to fix

          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]
          Severity: Minor
          Found in lib/teaspoon-devkit.rb - About 1 hr to fix

            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|
            Severity: Minor
            Found in lib/teaspoon/driver/browserstack.rb - About 1 hr to fix

            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;
            Severity: Minor
            Found in lib/teaspoon/driver/phantomjs/runner.js - About 1 hr to fix

              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
              Severity: Minor
              Found in lib/teaspoon/driver/browserstack.rb - About 45 mins to fix

              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|
              Severity: Minor
              Found in lib/teaspoon/environment.rb - About 45 mins to fix

              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]
              Severity: Minor
              Found in lib/teaspoon-devkit.rb - About 35 mins to fix

              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|
              Severity: Minor
              Found in lib/teaspoon/utility.rb - About 25 mins to fix

              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
              Severity: Minor
              Found in lib/teaspoon/deprecated.rb - About 25 mins to fix

              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
              Severity: Minor
              Found in lib/teaspoon/configuration.rb - About 25 mins to fix

              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)
              Severity: Minor
              Found in lib/teaspoon/coverage.rb - About 25 mins to fix

              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)
              Severity: Minor
              Found in lib/teaspoon/coverage.rb - About 25 mins to fix

              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

              Severity
              Category
              Status
              Source
              Language