Showing 531 of 531 total issues

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 static/script/06-jquery.ui.position.js and 1 other location - About 1 day to fix
static/script/06-jquery.ui.position.js on lines 346..371

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

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

            if ( data.collisionHeight > outerHeight ) {
                // element is initially over the top of within
                if ( overTop > 0 && overBottom <= 0 ) {
                    newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
                    position.top += overTop - newOverBottom;
Severity: Major
Found in static/script/06-jquery.ui.position.js and 1 other location - About 1 day to fix
static/script/06-jquery.ui.position.js on lines 309..334

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

Function ajax has 241 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ajax: function( url, options ) {

        // If url is an object, simulate pre-1.5 signature
        if ( typeof url === "object" ) {
            options = url;
Severity: Major
Found in static/script/01-jquery.js - About 1 day to fix

    Function setDocument has 230 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    setDocument = Sizzle.setDocument = function( node ) {
        var doc = node ? node.ownerDocument || node : preferredDoc;
    
        // If no document and documentElement is available, return
        if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
    Severity: Major
    Found in static/script/01-jquery.js - About 1 day to fix

      Function _create has 197 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _create: function() {
              // Some browsers only repeat keydown events, not keypress events,
              // so we use the suppressKeyPress flag to determine if we've already
              // handled the keydown event. #7269
              // Unfortunately the code for & in keypress is the same as the up arrow,
      Severity: Major
      Found in static/script/08-jquery.ui.autocomplete.js - About 7 hrs to fix

        Function html has 195 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function html() {
                var a, attributes, e, n, q, t, v, w = option.white, wmode;
                xmode = 'html';
                xquote = '';
                stack = null;
        Severity: Major
        Found in tools/jslint.js - About 7 hrs to fix

          Function html has 195 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function html() {
                  var a, attributes, e, n, q, t, v, w = option.white, wmode;
                  xmode = 'html';
                  xquote = '';
                  stack = null;
          Severity: Major
          Found in tools/jslint/fulljslint.js - About 7 hrs to fix

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

            /*!
             * jQuery UI Menu 1.10.3
             * http://jqueryui.com
             *
             * Copyright 2013 jQuery Foundation and other contributors
            Severity: Minor
            Found in static/script/07-jquery.ui.menu.js - About 7 hrs to fix

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

              /*!
               * jQuery UI Autocomplete 1.10.3
               * http://jqueryui.com
               *
               * Copyright 2013 jQuery Foundation and other contributors
              Severity: Minor
              Found in static/script/08-jquery.ui.autocomplete.js - About 7 hrs to fix

                Method call has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                Open

                  def call(context, page)
                    geometry = context.params[:geometry]
                    trim = context.params[:trim]
                    ps = page.mime.to_s =~ /postscript/
                    if ps || page.mime == 'application/pdf'
                Severity: Minor
                Found in plugins/aspects/image.rb - About 6 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function _setDimension has 167 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _setDimension: function () {
                            var viewport   = F.getViewport(),
                                steps      = 0,
                                canShrink  = false,
                                canExpand  = false,
                Severity: Major
                Found in plugins/misc/fancybox/script/01-jquery.fancybox.js - About 6 hrs to fix

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

                  /*!
                   * jQuery UI Position 1.10.3
                   * http://jqueryui.com
                   *
                   * Copyright 2013 jQuery Foundation and other contributors
                  Severity: Minor
                  Found in static/script/06-jquery.ui.position.js - About 6 hrs to fix

                    Function position has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    $.fn.position = function( options ) {
                        if ( !options || !options.of ) {
                            return _position.apply( this, arguments );
                        }
                    
                    
                    Severity: Major
                    Found in static/script/06-jquery.ui.position.js - About 5 hrs to fix

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

                      /*!
                       * jQuery UI Widget 1.10.3
                       * http://jqueryui.com
                       *
                       * Copyright 2013 jQuery Foundation and other contributors
                      Severity: Minor
                      Found in static/script/05-jquery.ui.widget.js - About 5 hrs to fix

                        Function itself has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var itself = function (s, o) {
                                var a, i;
                                JSLINT.errors = [];
                                predefined = Object.create(standard);
                                if (o) {
                        Severity: Major
                        Found in tools/jslint.js - About 5 hrs to fix

                          Function itself has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var itself = function (s, o) {
                                  var a, i;
                                  JSLINT.errors = [];
                                  predefined = Object.create(standard);
                                  if (o) {
                          Severity: Major
                          Found in tools/jslint/fulljslint.js - About 5 hrs to fix

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

                            description 'Git repository backend (Using rugged library)'
                            require 'rugged'
                            require 'fileutils'
                            
                            class RuggedRepository < Repository
                            Severity: Minor
                            Found in plugins/repositories/rugged_repository.rb - About 5 hrs to fix

                              Class Page has 40 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                class Page
                                  include Util
                                  include Hooks
                                  include Attributes
                              
                              
                              Severity: Minor
                              Found in lib/olelo/page.rb - About 5 hrs to fix

                                Function treeView has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    $.fn.treeView = function(options) {
                                        if (!options) {
                                            options = {};
                                        }
                                        if (!options.root) {
                                Severity: Major
                                Found in plugins/treeview/script/00-jquery.treeview.js - About 5 hrs to fix

                                  Function Callbacks has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  jQuery.Callbacks = function( options ) {
                                  
                                      // Convert options from String-formatted to Object-formatted if needed
                                      // (we check in cache first)
                                      options = typeof options === "string" ?
                                  Severity: Major
                                  Found in static/script/01-jquery.js - About 5 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language