3scale/porta

View on GitHub
db/migrate/20100125103539_browser_cms_tables.rb

Summary

Maintainability
D
3 days
Test Coverage

Method up has 357 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.up
    create_table "attachment_versions", :force => true do |t|
      t.integer  "attachment_id"
      t.integer  "version"
      t.string   "file_path"
Severity: Major
Found in db/migrate/20100125103539_browser_cms_tables.rb - About 1 day to fix

    File 20100125103539_browser_cms_tables.rb has 398 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class BrowserCmsTables < ActiveRecord::Migration
      def self.up
        create_table "attachment_versions", :force => true do |t|
          t.integer  "attachment_id"
          t.integer  "version"
    Severity: Minor
    Found in db/migrate/20100125103539_browser_cms_tables.rb - About 5 hrs to fix

      Method down has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.down
          drop_table :attachment_versions
          drop_table :attachments
          drop_table :categories
          drop_table :category_types
      Severity: Minor
      Found in db/migrate/20100125103539_browser_cms_tables.rb - About 1 hr to fix

        BrowserCmsTables#self.up has approx 322 statements
        Open

          def self.up

        A method with Too Many Statements is any method that has a large number of lines.

        Too Many Statements warns about any method that has more than 5 statements. Reek's smell detector for Too Many Statements counts +1 for every simple statement in a method and +1 for every statement within a control structure (if, else, case, when, for, while, until, begin, rescue) but it doesn't count the control structure itself.

        So the following method would score +6 in Reek's statement-counting algorithm:

        def parse(arg, argv, &error)
          if !(val = arg) and (argv.empty? or /\A-/ =~ (val = argv[0]))
            return nil, block, nil                                         # +1
          end
          opt = (val = parse_arg(val, &error))[1]                          # +2
          val = conv_arg(*val)                                             # +3
          if opt and !arg
            argv.shift                                                     # +4
          else
            val[0] = nil                                                   # +5
          end
          val                                                              # +6
        end

        (You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)

        BrowserCmsTables#self.down has approx 35 statements
        Open

          def self.down

        A method with Too Many Statements is any method that has a large number of lines.

        Too Many Statements warns about any method that has more than 5 statements. Reek's smell detector for Too Many Statements counts +1 for every simple statement in a method and +1 for every statement within a control structure (if, else, case, when, for, while, until, begin, rescue) but it doesn't count the control structure itself.

        So the following method would score +6 in Reek's statement-counting algorithm:

        def parse(arg, argv, &error)
          if !(val = arg) and (argv.empty? or /\A-/ =~ (val = argv[0]))
            return nil, block, nil                                         # +1
          end
          opt = (val = parse_arg(val, &error))[1]                          # +2
          val = conv_arg(*val)                                             # +3
          if opt and !arg
            argv.shift                                                     # +4
          else
            val[0] = nil                                                   # +5
          end
          val                                                              # +6
        end

        (You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)

        BrowserCmsTables#self.up calls 't.boolean "published", :default => false' 12 times
        Open

              t.boolean  "published",       :default => false
              t.boolean  "deleted",         :default => false
              t.boolean  "archived",        :default => false
              t.string   "version_comment"
              t.integer  "created_by_id"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "file_size"' 2 times
        Open

              t.integer  "file_size"
              t.datetime "created_at"
              t.datetime "updated_at"
              t.string   "name"
              t.boolean  "published",       :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "file_path"' 2 times
        Open

              t.string   "file_path"
              t.string   "file_location"
              t.string   "file_extension"
              t.string   "file_type"
              t.integer  "file_size"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "attachment_version"' 2 times
        Open

              t.integer  "attachment_version"
              t.boolean  "published",          :default => false
              t.boolean  "deleted",            :default => false
              t.boolean  "archived",           :default => false
              t.string   "version_comment"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "file_extension"' 2 times
        Open

              t.string   "file_extension"
              t.string   "file_type"
              t.integer  "file_size"
              t.datetime "created_at"
              t.datetime "updated_at"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.text "body"' 3 times
        Open

              t.text     "body"
              t.datetime "created_at"
              t.datetime "updated_at"
              t.boolean  "published",       :default => false
              t.boolean  "deleted",         :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.boolean "new_window", :default => false' 2 times
        Open

              t.boolean  "new_window",      :default => false
              t.datetime "created_at"
              t.datetime "updated_at"
              t.boolean  "published",       :default => false
              t.boolean  "deleted",         :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "page_id"' 4 times
        Open

              t.integer  "page_id"
              t.integer  "page_version"
              t.integer  "connectable_id"
              t.string   "connectable_type"
              t.integer  "connectable_version"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "language"' 2 times
        Open

              t.string   "language"
              t.boolean  "cacheable",          :default => false
              t.boolean  "hidden",             :default => false
              t.boolean  "published",          :default => false
              t.boolean  "deleted",            :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "type"' 6 times
        Open

              t.string   "type"
              t.string   "name"
              t.string   "format"
              t.string   "handler"
              t.text     "body"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "permission_id"' 2 times
        Open

              t.integer "permission_id"
            end
        
            create_table "group_sections", :force => true do |t|
              t.integer "group_id"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.boolean "cacheable", :default => false' 2 times
        Open

              t.boolean  "cacheable",          :default => false
              t.boolean  "hidden",             :default => false
              t.boolean  "published",          :default => false
              t.boolean  "deleted",            :default => false
              t.boolean  "archived",           :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "attachment_id"' 3 times
        Open

              t.integer  "attachment_id"
              t.integer  "version"
              t.string   "file_path"
              t.string   "file_location"
              t.string   "file_extension"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "position"' 2 times
        Open

              t.integer  "position"
              t.datetime "created_at"
              t.datetime "updated_at"
            end
        
        

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "group_type_id"' 2 times
        Open

              t.integer "group_type_id"
              t.integer "permission_id"
            end
        
            create_table "group_types", :force => true do |t|

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "path"' 3 times
        Open

              t.string   "path"
              t.string   "template_file_name"
              t.text     "description"
              t.text     "keywords"
              t.string   "language"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.boolean "archived", :default => false' 13 times
        Open

              t.boolean  "archived",        :default => false
              t.string   "version_comment"
              t.integer  "created_by_id"
              t.integer  "updated_by_id"
            end

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.boolean "deleted", :default => false' 13 times
        Open

              t.boolean  "deleted",         :default => false
              t.boolean  "archived",        :default => false
              t.string   "version_comment"
              t.integer  "created_by_id"
              t.integer  "updated_by_id"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "name"' 25 times
        Open

              t.string   "name"
              t.boolean  "published",       :default => false
              t.boolean  "deleted",         :default => false
              t.boolean  "archived",        :default => false
              t.string   "version_comment"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "template_file_name"' 2 times
        Open

              t.string   "template_file_name"
              t.text     "description"
              t.text     "keywords"
              t.string   "language"
              t.boolean  "cacheable",          :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.boolean "hidden", :default => false' 3 times
        Open

              t.boolean  "hidden",             :default => false
              t.boolean  "published",          :default => false
              t.boolean  "deleted",            :default => false
              t.boolean  "archived",           :default => false
              t.string   "version_comment"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "handler"' 2 times
        Open

              t.string   "handler"
              t.text     "body"
              t.datetime "created_at"
              t.datetime "updated_at"
              t.boolean  "published",       :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "title"' 2 times
        Open

              t.string   "title"
              t.string   "path"
              t.string   "template_file_name"
              t.text     "description"
              t.text     "keywords"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.text "description"' 2 times
        Open

              t.text     "description"
              t.text     "keywords"
              t.string   "language"
              t.boolean  "cacheable",          :default => false
              t.boolean  "hidden",             :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.datetime "updated_at"' 30 times
        Open

              t.datetime "updated_at"
              t.string   "name"
              t.boolean  "published",       :default => false
              t.boolean  "deleted",         :default => false
              t.boolean  "archived",        :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "version"' 12 times
        Open

              t.integer  "version"
              t.string   "file_path"
              t.string   "file_location"
              t.string   "file_extension"
              t.string   "file_type"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "file_type"' 2 times
        Open

              t.string   "file_type"
              t.integer  "file_size"
              t.datetime "created_at"
              t.datetime "updated_at"
              t.string   "name"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "created_by_id"' 13 times
        Open

              t.integer  "created_by_id"
              t.integer  "updated_by_id"
            end
        
            create_table "attachments", :force => true do |t|

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.text "keywords"' 2 times
        Open

              t.text     "keywords"
              t.string   "language"
              t.boolean  "cacheable",          :default => false
              t.boolean  "hidden",             :default => false
              t.boolean  "published",          :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "lock_version", :default => 0' 6 times
        Open

              t.integer  "lock_version",   :default => 0
              t.string   "file_path"
              t.string   "file_location"
              t.string   "file_extension"
              t.string   "file_type"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "format"' 2 times
        Open

              t.string   "format"
              t.string   "handler"
              t.text     "body"
              t.datetime "created_at"
              t.datetime "updated_at"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "file_location"' 2 times
        Open

              t.string   "file_location"
              t.string   "file_extension"
              t.string   "file_type"
              t.integer  "file_size"
              t.datetime "created_at"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.datetime "created_at"' 30 times
        Open

              t.datetime "created_at"
              t.datetime "updated_at"
              t.string   "name"
              t.boolean  "published",       :default => false
              t.boolean  "deleted",         :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "updated_by_id"' 13 times
        Open

              t.integer  "updated_by_id"
            end
        
            create_table "attachments", :force => true do |t|
              t.integer  "version"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "group_id"' 3 times
        Open

              t.integer "group_id"
              t.integer "permission_id"
            end
        
            create_table "group_sections", :force => true do |t|

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "content", :limit => 65537' 2 times
        Open

              t.string   "content",         :limit => 65537
              t.boolean  "published",                        :default => false
              t.boolean  "deleted",                          :default => false
              t.boolean  "archived",                         :default => false
              t.string   "version_comment"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.integer "section_id"' 2 times
        Open

              t.integer "section_id"
            end
        
            create_table "group_type_permissions", :force => true do |t|
              t.integer "group_type_id"

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "url"' 2 times
        Open

              t.string   "url"
              t.boolean  "new_window",      :default => false
              t.datetime "created_at"
              t.datetime "updated_at"
              t.boolean  "published",       :default => false

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up calls 't.string "version_comment"' 6 times
        Open

              t.string   "version_comment"
              t.integer  "created_by_id"
              t.integer  "updated_by_id"
            end
        
        

        Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

        Reek implements a check for Duplicate Method Call.

        Example

        Here's a very much simplified and contrived example. The following method will report a warning:

        def double_thing()
          @other.thing + @other.thing
        end

        One quick approach to silence Reek would be to refactor the code thus:

        def double_thing()
          thing = @other.thing
          thing + thing
        end

        A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

        class Other
          def double_thing()
            thing + thing
          end
        end

        The approach you take will depend on balancing other factors in your code.

        BrowserCmsTables#self.up has the variable name 't'
        Open

            create_table "attachment_versions", :force => true do |t|
              t.integer  "attachment_id"
              t.integer  "version"
              t.string   "file_path"
              t.string   "file_location"

        An Uncommunicative Variable Name is a variable name that doesn't communicate its intent well enough.

        Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            create_table "email_messages", :force => true do |t|
              t.string   "sender"
              t.text     "recipients"
              t.text     "subject"
              t.text     "cc"
        Severity: Major
        Found in db/migrate/20100125103539_browser_cms_tables.rb and 2 other locations - About 40 mins to fix
        db/migrate/20111128090920_dumping_unused_tables.rb on lines 43..53
        db/migrate/20111128090920_dumping_unused_tables.rb on lines 126..136

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 38.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            create_table "connectors", :force => true do |t|
              t.integer  "page_id"
              t.integer  "page_version"
              t.integer  "connectable_id"
              t.string   "connectable_type"
        Severity: Minor
        Found in db/migrate/20100125103539_browser_cms_tables.rb and 1 other location - About 35 mins to fix
        db/migrate/20120116105124_merge_connect_and_enterprise_data_models.rb on lines 34..43

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 35.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 5 locations. Consider refactoring.
        Open

            create_table "tasks", :force => true do |t|
              t.integer  "assigned_by_id"
              t.integer  "assigned_to_id"
              t.integer  "page_id"
              t.text     "comment"
        Severity: Major
        Found in db/migrate/20100125103539_browser_cms_tables.rb and 4 other locations - About 30 mins to fix
        db/migrate/20081112151449_tables_for_beast.rb on lines 33..41
        db/migrate/20111129172656_dropping_liquid_page_versions.rb on lines 8..16
        db/migrate/20111130110343_dropping_bcms_tasks.rb on lines 7..15
        db/migrate/20120116105124_merge_connect_and_enterprise_data_models.rb on lines 23..31

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 32.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

            create_table "section_nodes", :force => true do |t|
              t.integer  "section_id"
              t.string   "node_type"
              t.integer  "node_id"
              t.integer  "position"
        Severity: Minor
        Found in db/migrate/20100125103539_browser_cms_tables.rb and 6 other locations - About 15 mins to fix
        db/migrate/20100125103539_browser_cms_tables.rb on lines 252..258
        db/migrate/20100125103539_browser_cms_tables.rb on lines 261..267
        db/migrate/20100125103539_browser_cms_tables.rb on lines 313..319
        db/migrate/20100125103539_browser_cms_tables.rb on lines 365..371
        db/migrate/20111205143403_dropping_applications_and_application_tokens.rb on lines 15..21
        db/migrate/20121018100514_removing_bcms_tables.rb on lines 554..560

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 26.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

            create_table "permissions", :force => true do |t|
              t.string   "name"
              t.string   "full_name"
              t.string   "description"
              t.string   "for_module"
        Severity: Minor
        Found in db/migrate/20100125103539_browser_cms_tables.rb and 6 other locations - About 15 mins to fix
        db/migrate/20100125103539_browser_cms_tables.rb on lines 252..258
        db/migrate/20100125103539_browser_cms_tables.rb on lines 261..267
        db/migrate/20100125103539_browser_cms_tables.rb on lines 346..352
        db/migrate/20100125103539_browser_cms_tables.rb on lines 365..371
        db/migrate/20111205143403_dropping_applications_and_application_tokens.rb on lines 15..21
        db/migrate/20121018100514_removing_bcms_tables.rb on lines 554..560

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 26.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

            create_table "page_route_options", :force => true do |t|
              t.integer  "page_route_id"
              t.string   "type"
              t.string   "name"
              t.string   "value"
        Severity: Minor
        Found in db/migrate/20100125103539_browser_cms_tables.rb and 6 other locations - About 15 mins to fix
        db/migrate/20100125103539_browser_cms_tables.rb on lines 261..267
        db/migrate/20100125103539_browser_cms_tables.rb on lines 313..319
        db/migrate/20100125103539_browser_cms_tables.rb on lines 346..352
        db/migrate/20100125103539_browser_cms_tables.rb on lines 365..371
        db/migrate/20111205143403_dropping_applications_and_application_tokens.rb on lines 15..21
        db/migrate/20121018100514_removing_bcms_tables.rb on lines 554..560

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 26.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

            create_table "taggings", :force => true do |t|
              t.integer  "tag_id"
              t.integer  "taggable_id"
              t.string   "taggable_type"
              t.integer  "taggable_version"
        Severity: Minor
        Found in db/migrate/20100125103539_browser_cms_tables.rb and 6 other locations - About 15 mins to fix
        db/migrate/20100125103539_browser_cms_tables.rb on lines 252..258
        db/migrate/20100125103539_browser_cms_tables.rb on lines 261..267
        db/migrate/20100125103539_browser_cms_tables.rb on lines 313..319
        db/migrate/20100125103539_browser_cms_tables.rb on lines 346..352
        db/migrate/20111205143403_dropping_applications_and_application_tokens.rb on lines 15..21
        db/migrate/20121018100514_removing_bcms_tables.rb on lines 554..560

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 26.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

            create_table "page_routes", :force => true do |t|
              t.string   "name"
              t.string   "pattern"
              t.integer  "page_id"
              t.text     "code"
        Severity: Minor
        Found in db/migrate/20100125103539_browser_cms_tables.rb and 6 other locations - About 15 mins to fix
        db/migrate/20100125103539_browser_cms_tables.rb on lines 252..258
        db/migrate/20100125103539_browser_cms_tables.rb on lines 313..319
        db/migrate/20100125103539_browser_cms_tables.rb on lines 346..352
        db/migrate/20100125103539_browser_cms_tables.rb on lines 365..371
        db/migrate/20111205143403_dropping_applications_and_application_tokens.rb on lines 15..21
        db/migrate/20121018100514_removing_bcms_tables.rb on lines 554..560

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 26.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              t.string   "name"
              t.string   "path"
              t.boolean  "root",       :default => false
              t.boolean  "hidden",     :default => false
              t.datetime "created_at"
        Severity: Minor
        Found in db/migrate/20100125103539_browser_cms_tables.rb and 1 other location - About 15 mins to fix
        db/schema.rb on lines 858..863

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 25.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status