decko-commons/decko

View on GitHub

Showing 39 of 700 total issues

Module has too many lines. [123/100]
Open

      module VooApi
        # There are two primary options hashes:

        # - @normalized_options are determined upon initialization and do not change
        # after that.

This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Module has too many lines. [112/100]
Open

    module Render
      # view=open&layout=simple
      def render! view, view_options={}
        voo = View.new self, view, view_options, @voo
        with_voo voo do
Severity: Minor
Found in card/lib/card/format/render.rb by rubocop

This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Module has too many lines. [112/100]
Open

    module CardClass
      def create! opts
        card = new opts
        card.save!
        card

This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [109/100]
Open

  class Content < SimpleDelegator
    extend Clean

    Chunk # trigger autoload

Severity: Minor
Found in card/lib/card/content.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [107/100]
Open

class CardSpecLoader
  class << self
    def init
      require "spork"
      ENV["RAILS_ENV"] = "test"

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

File content_spec.rb has 367 lines of code (exceeds 250 allowed). Consider refactoring.
Open

RSpec.describe Card::Content do
  EXAMPLES = {
    nests: {
      content: "Some Literals: \\[{I'm not| a link]}, and " \
                '\\{{This Card|Is not Nestd}}' \
Severity: Minor
Found in card/spec/card/content_spec.rb - About 4 hrs to fix

File director_spec.rb has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

RSpec.describe "Card::Director" do
  STAGE_MAP = { VI: :initialize,
                VP: :prepare_to_validate,
                VV: :validate,
                SP: :prepare_to_store,
Severity: Minor
Found in card/spec/card/director_spec.rb - About 3 hrs to fix

Assignment Branch Condition size for swap_all_subsequences is too high. [25.4/15]
Open

    def swap_all_subsequences oldseq, newseq
      res = []
      i = 0
      while i <= num_parts - oldseq.num_parts
        # for performance reasons: check first character first then the rest
Severity: Minor
Found in cardname/lib/cardname/manipulate.rb by rubocop

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. [23/15]
Open

  def path_to page_name
    case page_name
    when /the home\s?page/
      "/"
    when /card (.*) with (.*) layout$/
Severity: Minor
Found in decko/features/support/paths.rb by rubocop

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.

Class View has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

  class View
    module Options
      # VooApi methods let developers use view options dynamically.
      module VooApi
        # There are two primary options hashes:
Severity: Minor
Found in card/lib/card/view/options/voo_api.rb - About 2 hrs to fix

Assignment Branch Condition size for path_to is too high. [22.87/15]
Open

  def path_to page_name
    case page_name
    when /the home\s?page/
      "/"
    when /card (.*) with (.*) layout$/
Severity: Minor
Found in decko/features/support/paths.rb by rubocop

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

Class Format has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Format
    # View rendering methods.
    #
    module Render
      # view=open&layout=simple
Severity: Minor
Found in card/lib/card/format/render.rb - About 2 hrs to fix

Assignment Branch Condition size for determine_image_size is too high. [19.52/15]
Open

  def determine_image_size
    voo.size =
      case
      when nest_mode == :closed then closed_size
      when voo.size.present?    then voo.size.to_sym
Severity: Minor
Found in mod/carrierwave/set/type/image.rb by rubocop

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

Assignment Branch Condition size for help is too high. [19.03/15]
Open

      def help command="generate"
        caller = Cardio::Command.bin_name
        puts "Usage:"
        puts "  #{caller} #{command} GENERATOR [args] [options]".green
        puts
Severity: Minor
Found in card/lib/cardio/generators.rb by rubocop

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

Cyclomatic complexity for path_to is too high. [10/6]
Open

  def path_to page_name
    case page_name
    when /the home\s?page/
      "/"
    when /card (.*) with (.*) layout$/
Severity: Minor
Found in decko/features/support/paths.rb by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Assignment Branch Condition size for load_stylesheets is too high. [18/15]
Open

def load_stylesheets
  add_bs_stylesheet "variables"
  add_bs_stylesheet "rfs", subdir: "vendor"
  mixin_stylesheets.each { |name| add_bs_stylesheet name, subdir: "mixins" }
  main_stylesheets.each { |name| add_bs_stylesheet name }

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

Cyclomatic complexity for absolutize_contextual_parts is too high. [8/6]
Open

    def absolutize_contextual_parts context
      parts.map do |part|
        case part
        when /^_user$/i            then user_part part
        when /^_main$/i            then self.class.params[:main_name]
Severity: Minor
Found in cardname/lib/cardname/contextual.rb by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Method has too many lines. [17/15]
Open

      def help command="generate"
        caller = Cardio::Command.bin_name
        puts "Usage:"
        puts "  #{caller} #{command} GENERATOR [args] [options]".green
        puts
Severity: Minor
Found in card/lib/cardio/generators.rb by rubocop

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 with_wrapper is too high. [17.38/15]
Open

      def with_wrapper
        if voo.layout.present?
          voo.wrap ||= []
          layout = voo.layout.to_name.key
          # don't wrap twice with modals or overlays
Severity: Minor
Found in card/lib/card/format/wrapper.rb by rubocop

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. [17/15]
Open

  def scope_of section
    case section

    when /main card content/
      with_or_without_main_frame ".d0-card-content"
Severity: Minor
Found in decko/features/support/scopes.rb by rubocop

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.

Severity
Category
Status
Source
Language