thundergolfer/mAIcroft

View on GitHub

Showing 322 of 322 total issues

Avoid deeply nested control flow statements.
Open

                        if ( matches[ sel ] ) {
                            matches.push( handleObj );
                        }
Severity: Major
Found in docs/_build/html/_static/jquery-1.11.1.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                    if ( typeof xhr.responseText === "string" ) {
                                        responses.text = xhr.responseText;
                                    }
    Severity: Major
    Found in docs/_build/html/_static/jquery-1.11.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/_build/html/_static/jquery-1.11.1.js - About 45 mins to fix

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

            def humanize_days(days):
                """
                Return text with years, months and days given number of days.
        
                """
        Severity: Minor
        Found in maicroft/util.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 __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self, username, json_data=None):
                # Populate username and about data
                self.username = username
        
                self.comments = []
        Severity: Minor
        Found in maicroft/users/reddit_user.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 parse_cmd_line has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def parse_cmd_line():
            """Command-line argument parsing."""
        
            usage = ("usage: %prog [options] USERNAME TARGET\n\n"
                     "USERNAME sets your Reddit username for the bot\n"
        Severity: Minor
        Found in maicroft/words/most_used_words.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

        Avoid deeply nested control flow statements.
        Open

                                if child["name"] == level_topic:
                                    child_node = child
                                    found_child = True
                                    break
                            if not found_child:
        Severity: Major
        Found in maicroft/users/reddit_user.py - About 45 mins to fix

          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/_build/html/_static/doctools.js and 1 other location - About 45 mins to fix
          docs/_build/html/_static/doctools.js on lines 264..269

          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

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

          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

          Avoid deeply nested control flow statements.
          Open

                                  if key not in ["gender", "religion and spirituality"]:
                                      synopsis[key]["data"].append(
                                          {
                                              "value": coalesced_topic,
                                              "count": count
          Severity: Major
          Found in maicroft/users/reddit_user.py - About 45 mins to fix

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

                            cur = elem.nodeType === 1 && ( elem.className ?
                                ( " " + elem.className + " " ).replace( rclass, " " ) :
                                " "
                            );
            Severity: Minor
            Found in docs/_build/html/_static/jquery-1.11.1.js and 1 other location - About 40 mins to fix
            docs/_build/html/_static/jquery-1.11.1.js on lines 8343..8346

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

            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

                            cur = elem.nodeType === 1 && ( elem.className ?
                                ( " " + elem.className + " " ).replace( rclass, " " ) :
                                ""
                            );
            Severity: Minor
            Found in docs/_build/html/_static/jquery-1.11.1.js and 1 other location - About 40 mins to fix
            docs/_build/html/_static/jquery-1.11.1.js on lines 8301..8304

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

            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/_build/html/_static/searchtools.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
                      return;
                  }
              Severity: Major
              Found in docs/_build/html/_static/jquery-1.11.1.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                        if ( s.crossDomain == null ) {
                            parts = rurl.exec( s.url.toLowerCase() );
                            s.crossDomain = !!( parts &&
                                ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
                                    ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
                Severity: Major
                Found in docs/_build/html/_static/jquery-1.11.1.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if ( support.matchesSelector && documentIsHTML &&
                          ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
                          ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
                  
                          try {
                  Severity: Major
                  Found in docs/_build/html/_static/jquery-1.11.1.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++ ) {
                                        if ( Expr.relative[ tokens[j].type ] ) {
                    Severity: Major
                    Found in docs/_build/html/_static/jquery-1.11.1.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                      if ( !support.opacity ) {
                          jQuery.cssHooks.opacity = {
                              get: function( elem, computed ) {
                                  // IE uses filters for opacity
                                  return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
                      Severity: Major
                      Found in docs/_build/html/_static/jquery-1.11.1.js - About 40 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/_build/html/_static/jquery-1.11.1.js - About 35 mins to fix

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

                              remove: function( elem, types, handler, selector, mappedTypes ) {
                          Severity: Minor
                          Found in docs/_build/html/_static/jquery-1.11.1.js - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language