otwcode/otwarchive

View on GitHub

Showing 1,203 of 1,203 total issues

File jquery-ui.js has 11613 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! jQuery UI - v1.10.0 - 2013-01-17
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.slider.js, jquery.ui.sortable.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
* Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */

Severity: Major
Found in public/javascripts/jquery-ui.js - About 1 mo to fix

    File jquery.js has 6540 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery JavaScript Library v1.9.0
     * http://jquery.com/
     *
     * Includes Sizzle.js
    Severity: Major
    Found in public/javascripts/jquery.js - About 2 wks to fix

      Function TokenList has 568 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      $.TokenList = function (input, url_or_data, settings) {
          //
          // Initialization
          //
      
      
      Severity: Major
      Found in public/javascripts/jquery.tokeninput.js - About 2 days to fix

        Class Work has 110 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Work < ApplicationRecord
          include Filterable
          include CreationNotifier
          include Collectible
          include Bookmarkable
        Severity: Major
        Found in app/models/work.rb - About 2 days to fix

          File work.rb has 848 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class Work < ApplicationRecord
            include Filterable
            include CreationNotifier
            include Collectible
            include Bookmarkable
          Severity: Major
          Found in app/models/work.rb - About 2 days to fix

            File tag.rb has 836 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require "unicode_utils/casefold"
            
            class Tag < ApplicationRecord
              include Searchable
              include StringCleaner
            Severity: Major
            Found in app/models/tag.rb - About 2 days to fix

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

                  _convertPositionTo: function(d, pos) {
              
                      if(!pos) {
                          pos = this.position;
                      }
              Severity: Major
              Found in public/javascripts/jquery-ui.js and 1 other location - About 2 days to fix
              public/javascripts/jquery-ui.js on lines 12916..12940

              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 356.

              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

                  _convertPositionTo: function(d, pos) {
              
                      if(!pos) {
                          pos = this.position;
                      }
              Severity: Major
              Found in public/javascripts/jquery-ui.js and 1 other location - About 2 days to fix
              public/javascripts/jquery-ui.js on lines 6234..6258

              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 356.

              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

              Class Tag has 103 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class Tag < ApplicationRecord
                include Searchable
                include StringCleaner
                include WorksOwner
                include Wrangleable
              Severity: Major
              Found in app/models/tag.rb - About 1 day to fix

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

                    _getParentOffset: function() {
                
                
                        //Get the offsetParent and cache its position
                        this.offsetParent = this.helper.offsetParent();
                Severity: Major
                Found in public/javascripts/jquery-ui.js and 1 other location - About 1 day to fix
                public/javascripts/jquery-ui.js on lines 6134..6161

                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 340.

                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

                    _getParentOffset: function() {
                
                        //Get the offsetParent and cache its position
                        this.offsetParent = this.helper.offsetParent();
                        var po = this.offsetParent.offset();
                Severity: Major
                Found in public/javascripts/jquery-ui.js and 1 other location - About 1 day to fix
                public/javascripts/jquery-ui.js on lines 12828..12855

                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 340.

                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

                File works_controller.rb has 788 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class WorksController < ApplicationController
                  # only registered users and NOT admin should be able to create new works
                  before_action :load_collection
                  before_action :load_owner, only: [:index]
                  before_action :users_only, except: [:index, :show, :navigate, :search, :collected, :edit_tags, :update_tags, :drafts, :share]
                Severity: Major
                Found in app/controllers/works_controller.rb - About 1 day to fix

                  Method update has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def update
                      authorize Skin, :index?
                  
                      flash[:notice] = []
                      modified_skin_titles = []
                  Severity: Minor
                  Found in app/controllers/admin/skins_controller.rb - About 1 day 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

                  File jquery.tokeninput.js has 722 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*
                   * jQuery Plugin: Tokenizing Autocomplete Text Entry
                   * Version 1.4.2
                   *
                   * Copyright (c) 2009 James Smith (http://loopj.com)
                  Severity: Major
                  Found in public/javascripts/jquery.tokeninput.js - About 1 day to fix

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

                        _adjustOffsetFromHelper: function(obj) {
                            if (typeof obj === "string") {
                                obj = obj.split(" ");
                            }
                            if ($.isArray(obj)) {
                    Severity: Major
                    Found in public/javascripts/jquery-ui.js and 1 other location - About 1 day to fix
                    public/javascripts/jquery-ui.js on lines 12807..12826

                    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 296.

                    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

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

                        _adjustOffsetFromHelper: function(obj) {
                            if (typeof obj === "string") {
                                obj = obj.split(" ");
                            }
                            if ($.isArray(obj)) {
                    Severity: Major
                    Found in public/javascripts/jquery-ui.js and 1 other location - About 1 day to fix
                    public/javascripts/jquery-ui.js on lines 6113..6132

                    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 296.

                    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

                    File story_parser.rb has 705 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    class StoryParser
                      require 'timeout'
                      require 'nokogiri'
                      require 'mechanize'
                      require 'open-uri'
                    Severity: Major
                    Found in app/models/story_parser.rb - About 1 day to fix

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

                        $('.check_all').each(function(){
                          $(this).click(function(event){
                            var filter = $(this).data('checkbox-id-filter');
                            var checkboxes;
                            if (filter) {
                      Severity: Major
                      Found in public/javascripts/application.js and 1 other location - About 1 day to fix
                      public/javascripts/application.js on lines 163..181

                      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 258.

                      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

                        $('.check_none').each(function(){
                          $(this).click(function(event){
                            var filter = $(this).data('checkbox-id-filter');
                            var checkboxes;
                            if (filter) {
                      Severity: Major
                      Found in public/javascripts/application.js and 1 other location - About 1 day to fix
                      public/javascripts/application.js on lines 143..161

                      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 258.

                      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

                                  if ( data.collisionWidth > outerWidth ) {
                                      // element is initially over the left side of within
                                      if ( overLeft > 0 && overRight <= 0 ) {
                                          newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
                                          position.left += overLeft - newOverRight;
                      Severity: Major
                      Found in public/javascripts/jquery-ui.js and 1 other location - About 1 day to fix
                      public/javascripts/jquery-ui.js on lines 1322..1347

                      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 256.

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language