decko-commons/decko

View on GitHub

Showing 999 of 1,011 total issues

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

    class ActRenderer
      def initialize format, act, args
        @format = format
        @act = act
        @act_card = act.card

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

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.

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

  class Migration < ActiveRecord::Migration[4.2]
    include Card::Model::SaveHelper unless ENV["NO_CARD_LOAD"]
    @type = :deck_cards

    class << self
Severity: Minor
Found in card/lib/cardio/migration.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. [116/100]
Open

  class Action < Cardio::Record
    include Differ
    extend Admin

    belongs_to :act, foreign_key: :card_act_id, inverse_of: :ar_actions
Severity: Minor
Found in mod/history/lib/card/action.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. [115/100]
Open

  class Content < SimpleDelegator
    extend Clean
    extend Truncate

    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.

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.

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

  class Railtie < Rails::Railtie
    # if you disable inline styles tinymce's formatting options stop working
    config.allow_inline_styles = true
    config.delaying = nil
    config.token_expiry = 2.days
Severity: Minor
Found in card/lib/cardio/railtie.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

Class ActRenderer has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

    class ActRenderer
      def initialize format, act, args
        @format = format
        @act = act
        @act_card = act.card
Severity: Minor
Found in mod/history/lib/card/act/act_renderer.rb - About 3 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

File permissions_spec.rb has 281 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class ::Card
  def writeable_by user
    Card::Auth.as(user.id) { ok? :update }
  end

Severity: Minor
Found in mod/permissions/spec/set/all/permissions_spec.rb - About 2 hrs to fix

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

  def accordion_panel title, body, collapse_id, _panel_heading_link=false
    if body
      <<-HTML
        <div class="card-header" role="tab" id="heading-#{collapse_id}">
          <h5 class="mb-0">

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. [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 Migration has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Migration < ActiveRecord::Migration[4.2]
    include Card::Model::SaveHelper unless ENV["NO_CARD_LOAD"]
    @type = :deck_cards

    class << self
Severity: Minor
Found in card/lib/cardio/migration.rb - About 2 hrs to fix

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

Severity
Category
Status
Source
Language