jacquev6/ActionTree

View on GitHub

Showing 197 of 197 total issues

Avoid deeply nested control flow statements.
Open

                        while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
                            cur = cur.replace( " " + clazz + " ", " " );
                        }
Severity: Major
Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if ( !selector ) {
                            push.apply( results, seed );
                            return results;
                        }
    Severity: Major
    Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ( ( event.result = ret ) === false ) {
                                  event.preventDefault();
                                  event.stopPropagation();
                              }
      Severity: Major
      Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

        Function splitQuery has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function splitQuery(query) {
            var result = [];
            var start = -1;
            for (var i = 0; i < query.length; i++) {
                if (splitChars[query.charCodeAt(i)]) {
        Severity: Minor
        Found in docs/_static/language_data.js - About 45 mins 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

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

                  case 37: // left
                    var prevHref = $('link[rel="prev"]').prop('href');
                    if (prevHref) {
                      window.location.href = prevHref;
                      return false;
        Severity: Minor
        Found in docs/_static/doctools.js and 1 other location - About 45 mins to fix
        docs/_static/doctools.js on lines 298..303

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

        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 __nearest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def __nearest(v, values):
                for i, value in enumerate(values):
                    if v < value:
                        break
                if i == 0:
        Severity: Minor
        Found in ActionTree/__init__.py - About 45 mins 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

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

        try:
            stderr = ctypes.c_void_p.in_dll(libc, "stderr")
        except ValueError:  # pragma no cover: specific to macOS
            stderr = ctypes.c_void_p.in_dll(libc, "__stderrp")
        Severity: Minor
        Found in ActionTree/__init__.py and 1 other location - About 45 mins to fix
        ActionTree/__init__.py on lines 16..19

        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

        Function _allocate_resources has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def _allocate_resources(self, action):
                for (resource, quantity) in action.resources_required:
                    used = self.resources_used.setdefault(resource, 0)
                    if used == 0:
                        # Allow actions requiring more than available to run when they are alone requiring this resource
        Severity: Minor
        Found in ActionTree/__init__.py - About 45 mins 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 display has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                def display(self):
                    num_lines = self.num_lines[self.status]
                    title = "\"{}\" ({} t={:.2f}s)".format(self.label, self.status[1], self.time.total_seconds())
                    print()
                    print(title)
        Severity: Minor
        Found in demo/demo.py - About 45 mins 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

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

                  case 39: // right
                    var nextHref = $('link[rel="next"]').prop('href');
                    if (nextHref) {
                      window.location.href = nextHref;
                      return false;
        Severity: Minor
        Found in docs/_static/doctools.js and 1 other location - About 45 mins to fix
        docs/_static/doctools.js on lines 292..297

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

        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

        try:
            stdout = ctypes.c_void_p.in_dll(libc, "stdout")
        except ValueError:  # pragma no cover: specific to macOS
            stdout = ctypes.c_void_p.in_dll(libc, "__stdoutp")
        Severity: Minor
        Found in ActionTree/__init__.py and 1 other location - About 45 mins to fix
        ActionTree/__init__.py on lines 20..23

        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

        Consider simplifying this complex logical expression.
        Open

                if (terms[excluded[i]] == file ||
                    titleterms[excluded[i]] == file ||
                    $u.contains(terms[excluded[i]] || [], file) ||
                    $u.contains(titleterms[excluded[i]] || [], file)) {
                  valid = false;
        Severity: Major
        Found in docs/_static/searchtools.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                      if ( matcher[ expando ] ) {
          
                          // Find the next relative operator (if any) for proper handling
                          j = ++i;
                          for ( ; j < len; j++ ) {
          Severity: Major
          Found in docs/_static/jquery-3.5.1.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                    if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
                        context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
            
                        context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
                            .replace( runescape, funescape ), context ) || [] )[ 0 ];
            Severity: Major
            Found in docs/_static/jquery-3.5.1.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

              if ( !support.focusin ) {
                  jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
              
                      // Attach a single capturing handler on the document while someone wants focusin/focusout
                      var handler = function( event ) {
              Severity: Major
              Found in docs/_static/jquery-3.5.1.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                            if ( support.qsa &&
                                !nonnativeSelectorCache[ selector + " " ] &&
                                ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
                
                                // Support: IE 8 only
                Severity: Major
                Found in docs/_static/jquery-3.5.1.js - About 40 mins to fix

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

                              for ( i = 0, l = srcElements.length; i < l; i++ ) {
                                  fixInput( srcElements[ i ], destElements[ i ] );
                              }
                  Severity: Minor
                  Found in docs/_static/jquery-3.5.1.js and 1 other location - About 40 mins to fix
                  docs/_static/jquery-3.5.1.js on lines 6189..6191

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

                  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

                                  for ( i = 0, l = srcElements.length; i < l; i++ ) {
                                      cloneCopyEvent( srcElements[ i ], destElements[ i ] );
                                  }
                  Severity: Minor
                  Found in docs/_static/jquery-3.5.1.js and 1 other location - About 40 mins to fix
                  docs/_static/jquery-3.5.1.js on lines 6178..6180

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

                  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 buildFragment has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function buildFragment( elems, context, scripts, selection, ignored ) {
                  Severity: Minor
                  Found in docs/_static/jquery-3.5.1.js - About 35 mins to fix

                    Function CHILD has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            "CHILD": function( type, what, _argument, first, last ) {
                    Severity: Minor
                    Found in docs/_static/jquery-3.5.1.js - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language