Showing 531 of 531 total issues

Consider simplifying this complex logical expression.
Open

            if ( event.pageX == null && original.clientX != null ) {
                eventDoc = event.target.ownerDocument || document;
                doc = eventDoc.documentElement;
                body = eventDoc.body;

Severity: Critical
Found in static/script/01-jquery.js - About 5 hrs to fix

    Function support has 119 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    jQuery.support = (function() {
    
        var support, all, a,
            input, select, fragment,
            opt, eventName, isSupported, i,
    Severity: Major
    Found in static/script/01-jquery.js - About 4 hrs to fix

      Function doTag has 118 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function doTag(n, a) {
              var i, t = htmltag[n], x;
              src = false;
              if (!t) {
                  error("Unrecognized tag '<{a}>'.",
      Severity: Major
      Found in tools/jslint.js - About 4 hrs to fix

        Function doTag has 118 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function doTag(n, a) {
                var i, t = htmltag[n], x;
                src = false;
                if (!t) {
                    error("Unrecognized tag '<{a}>'.",
        Severity: Major
        Found in tools/jslint/fulljslint.js - About 4 hrs to fix

          Function styleSelector has 116 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function styleSelector() {
                  if (nexttoken.identifier) {
                      if (!is_own(htmltag, option.cap ?
                              nexttoken.value.toLowerCase() : nexttoken.value)) {
                          warning("Expected a tagName, and instead saw {a}.",
          Severity: Major
          Found in tools/jslint.js - About 4 hrs to fix

            Function styleSelector has 116 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function styleSelector() {
                    if (nexttoken.identifier) {
                        if (!is_own(htmltag, option.cap ?
                                nexttoken.value.toLowerCase() : nexttoken.value)) {
                            warning("Expected a tagName, and instead saw {a}.",
            Severity: Major
            Found in tools/jslint/fulljslint.js - About 4 hrs to fix

              Function string has 113 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              function string(x) {
                                  var c, j, r = '';
              
                                  if (jsonmode && x !== '"') {
                                      warningAt("Strings must use doublequote.",
              Severity: Major
              Found in tools/jslint.js - About 4 hrs to fix

                Function string has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                function string(x) {
                                    var c, j, r = '';
                
                                    if (jsonmode && x !== '"') {
                                        warningAt("Strings must use doublequote.",
                Severity: Major
                Found in tools/jslint/fulljslint.js - About 4 hrs to fix

                  Function report has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      itself.report = function (option) {
                          var data = itself.data();
                  
                          var a = [], c, e, err, f, i, k, l, m = '', n, o = [], s;
                  
                  
                  Severity: Major
                  Found in tools/jslint.js - About 4 hrs to fix

                    Function report has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        itself.report = function (option) {
                            var data = itself.data();
                    
                            var a = [], c, e, err, f, i, k, l, m = '', n, o = [], s;
                    
                    
                    Severity: Major
                    Found in tools/jslint/fulljslint.js - About 4 hrs to fix

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

                              if ( this._hasScroll() ) {
                                  base = this.active.offset().top;
                                  height = this.element.height();
                                  this.active.nextAll( ".ui-menu-item" ).each(function() {
                                      item = $( this );
                      Severity: Major
                      Found in static/script/07-jquery.ui.menu.js and 1 other location - About 4 hrs to fix
                      static/script/07-jquery.ui.menu.js on lines 591..602

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

                      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 ( this._hasScroll() ) {
                                  base = this.active.offset().top;
                                  height = this.element.height();
                                  this.active.prevAll( ".ui-menu-item" ).each(function() {
                                      item = $( this );
                      Severity: Major
                      Found in static/script/07-jquery.ui.menu.js and 1 other location - About 4 hrs to fix
                      static/script/07-jquery.ui.menu.js on lines 567..579

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

                      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

                      Method show_page has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def show_page
                          params[:aspect] ||= 'subpages' if params[:path].to_s.ends_with? '/'
                      
                          env['HTTP_ACCEPT'].to_s =~ %r{[\w\.\+\-\*]+/[\*\w\.\+\-]+}
                          preferred_mime = $&
                      Severity: Minor
                      Found in plugins/aspects/main.rb - About 4 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

                      Method cache_control has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def cache_control(options)
                            return if !Config['production']
                      
                            if options[:no_cache]
                              response.headers.delete('ETag')
                      Severity: Minor
                      Found in lib/olelo/helper.rb - About 4 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 _start has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              _start: function (index) {
                                  var coming = {},
                                      obj,
                                      href,
                                      type,
                      Severity: Major
                      Found in plugins/misc/fancybox/script/01-jquery.fancybox.js - About 3 hrs to fix

                        Function open has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                open: function (group, opts) {
                                    if (!group) {
                                        return;
                                    }
                        
                        
                        Severity: Major
                        Found in plugins/misc/fancybox/script/01-jquery.fancybox.js - About 3 hrs to fix

                          Function defaultPrefilter has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function defaultPrefilter( elem, props, opts ) {
                              /*jshint validthis:true */
                              var prop, index, length,
                                  value, dataShow, toggle,
                                  tween, hooks, oldfire,
                          Severity: Major
                          Found in static/script/01-jquery.js - About 3 hrs to fix

                            Function Selection has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              var Selection = (function() {
                            
                                  var hasRange = (typeof document.selection !== 'undefined' && typeof document.selection.createRange !== 'undefined');
                            
                                return {
                            Severity: Major
                            Found in plugins/editor/markup/script/00-jquery.textselection.js - About 3 hrs to fix

                              Function doOption has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function doOption() {
                                      var b, obj, filter, o = nexttoken.value, t, v;
                                      switch (o) {
                                      case '*/':
                                          error("Unbegun comment.");
                              Severity: Major
                              Found in tools/jslint.js - About 3 hrs to fix

                                Function doOption has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function doOption() {
                                        var b, obj, filter, o = nexttoken.value, t, v;
                                        switch (o) {
                                        case '*/':
                                            error("Unbegun comment.");
                                Severity: Major
                                Found in tools/jslint/fulljslint.js - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language