Showing 463 of 531 total issues

Function str has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function str(key, holder) {

// Produce a string from holder[key].

        var i,          // The loop counter.
Severity: Major
Found in static/script/00-json2.js - About 2 hrs to fix

    Function statements has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function statements(begin) {
            var a = [], f, p;
            if (begin && !use_strict() && option.strict) {
                warning('Missing "use strict" statement.', nexttoken);
            }
    Severity: Major
    Found in tools/jslint/fulljslint.js - About 2 hrs to fix

      Method run has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

        def run(data = nil)
          cmd = @cmd.join(' | ')
          return `#{cmd}` if !data
          Open3.popen3(cmd) do |stdin, stdout, stderr|
            output = ''
      Severity: Minor
      Found in plugins/utils/shell.rb - About 2 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 pagination has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def pagination(path, page_count, page_nr, options = {})
            return if page_count <= 1
            unlimited = options.delete(:unlimited)
            li = []
            li << if page_nr > 1
      Severity: Minor
      Found in lib/olelo/helper.rb - About 2 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 done has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function done( status, nativeStatusText, responses, headers ) {
                  var isSuccess, success, error, response, modified,
                      statusText = nativeStatusText;
      
                  // Called once
      Severity: Major
      Found in static/script/01-jquery.js - About 2 hrs to fix

        Function exps has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            infix('(', function (left, that) {
                if (prevtoken.id !== '}' && prevtoken.id !== ')') {
                    nobreak(prevtoken, token);
                }
                nospace();
        Severity: Major
        Found in tools/jslint.js - About 2 hrs to fix

          Function exps has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              infix('(', function (left, that) {
                  if (prevtoken.id !== '}' && prevtoken.id !== ')') {
                      nobreak(prevtoken, token);
                  }
                  nospace();
          Severity: Major
          Found in tools/jslint/fulljslint.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                                        if ((i.id === '(number)' && /[.+\-Ee]/.test(i.value)) ||
                                                (i.id === '-' && !i.right) ||
                                                i.id === '(string)' || i.id === '[' ||
                                                i.id === '{' || i.id === 'true' ||
                                                i.id === 'false' ||
            Severity: Critical
            Found in tools/jslint.js - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                          if ((i.id === '(number)' && /[.+\-Ee]/.test(i.value)) ||
                                                  (i.id === '-' && !i.right) ||
                                                  i.id === '(string)' || i.id === '[' ||
                                                  i.id === '{' || i.id === 'true' ||
                                                  i.id === 'false' ||
              Severity: Critical
              Found in tools/jslint/fulljslint.js - About 2 hrs to fix

                Class GitrbRepository has 24 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class GitrbRepository < Repository
                  CONTENT_EXT   = '.content'
                  ATTRIBUTE_EXT = '.attributes'
                
                  def initialize(config)
                Severity: Minor
                Found in plugins/repositories/gitrb_repository.rb - About 2 hrs to fix

                  Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                      if ( postFilter && !postFilter[ expando ] ) {
                          postFilter = setMatcher( postFilter );
                      }
                      if ( postFinder && !postFinder[ expando ] ) {
                  Severity: Major
                  Found in static/script/01-jquery.js - About 2 hrs to fix

                    Method build_path has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def build_path(page, options = {})
                          options = options.dup
                          action = options.delete(:action)
                          version = options.delete(:version)
                          path = (page.try(:path) || page).to_s
                    Severity: Minor
                    Found in lib/olelo/helper.rb - About 2 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 superMatcher has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            superMatcher = function( seed, context, xml, results, expandContext ) {
                                var elem, j, matcher,
                                    setMatched = [],
                                    matchedCount = 0,
                                    i = "0",
                    Severity: Major
                    Found in static/script/01-jquery.js - About 2 hrs to fix

                      Function styleValue has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function styleValue(v) {
                              var i = 0,
                                  n,
                                  once,
                                  match,
                      Severity: Major
                      Found in tools/jslint.js - About 2 hrs to fix

                        Function styleValue has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function styleValue(v) {
                                var i = 0,
                                    n,
                                    once,
                                    match,
                        Severity: Major
                        Found in tools/jslint/fulljslint.js - About 2 hrs to fix

                          Method parse has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def self.parse(patch, *h)
                                h = h.size == 1 ? h[0] : Adapter.new(h)
                                src = dst = nil
                                state = :start
                                h.initialize!
                          Severity: Major
                          Found in lib/olelo/patch.rb - About 2 hrs to fix

                            Function Deferred has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                Deferred: function( func ) {
                                    var tuples = [
                                            // action, add listener, listener list, final state
                                            [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
                                            [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
                            Severity: Major
                            Found in static/script/01-jquery.js - About 2 hrs to fix

                              File patch.rb has 266 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              module Olelo
                                class PatchParser
                                  include Util
                              
                                  class Handler
                              Severity: Minor
                              Found in lib/olelo/patch.rb - About 2 hrs to fix

                                Function CHILD has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        "CHILD": function( type, what, argument, first, last ) {
                                            var simple = type.slice( 0, 3 ) !== "nth",
                                                forward = type.slice( -4 ) !== "last",
                                                ofType = what === "of-type";
                                
                                
                                Severity: Major
                                Found in static/script/01-jquery.js - About 2 hrs to fix

                                  Function doAttribute has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function doAttribute(n, a, v) {
                                          var u, x;
                                          if (a === 'id') {
                                              u = typeof v === 'string' ? v.toUpperCase() : '';
                                              if (ids[u] === true) {
                                  Severity: Major
                                  Found in tools/jslint.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language