thundergolfer/mAIcroft

View on GitHub

Showing 322 of 322 total issues

Function process_npn_phrase has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def process_npn_phrase(self, npn_tree):
        """
        Given a phrase of the form noun-preposition-noun, returns noun
        and preposition-noun phrases.

Severity: Minor
Found in maicroft/text_parser.py - About 55 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 3 locations. Consider refactoring.
Open

    def pet_animal(self, word):
        """
        Returns word if word is in a predefined list of pet animals.

        """
Severity: Major
Found in maicroft/text_parser.py and 2 other locations - About 55 mins to fix
maicroft/text_parser.py on lines 157..165
maicroft/text_parser.py on lines 179..189

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

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

var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Severity: Major
Found in docs/_build/html/_static/jquery-1.11.1.js - About 50 mins to fix

    Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in maicroft/social_objects.py - About 50 mins to fix

      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(
      Severity: Major
      Found in maicroft/social_objects.py - About 50 mins to fix

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

                    if after:
                        url = base_url + "&after={}".format(after)
                        # reddit may rate limit if we don't wait for 2 seconds
                        # between successive requests. If that happens,
                        # uncomment and increase sleep time in the following line.
        Severity: Minor
        Found in maicroft/users/reddit_user.py and 1 other location - About 50 mins to fix
        maicroft/users/reddit_user.py on lines 363..370

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

        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 after:
                        url = base_url + "&after={}".format(after)
                        # reddit may rate limit if we don't wait for 2 seconds
                        # between successive requests. If that happens,
                        # uncomment and increase sleep time in the following line.
        Severity: Minor
        Found in maicroft/users/reddit_user.py and 1 other location - About 50 mins to fix
        maicroft/users/reddit_user.py on lines 423..430

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

        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

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

            if (support.deleteExpando == null) {
                // Support: IE<9
                support.deleteExpando = true;
                try {
                    delete div.test;
        Severity: Minor
        Found in docs/_build/html/_static/jquery-1.11.1.js and 1 other location - About 50 mins to fix
        docs/_build/html/_static/jquery-1.11.1.js on lines 4217..4225

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

        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

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

            if (support.deleteExpando == null) {
                // Support: IE<9
                support.deleteExpando = true;
                try {
                    delete div.test;
        Severity: Minor
        Found in docs/_build/html/_static/jquery-1.11.1.js and 1 other location - About 50 mins to fix
        docs/_build/html/_static/jquery-1.11.1.js on lines 3599..3607

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

        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 ( copyIsArray ) {
                                copyIsArray = false;
                                clone = src && jQuery.isArray(src) ? src : [];
        
                            } else {
        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 ( (elem = matcherOut[i]) ) {
                                      // Restore matcherIn since elem is not yet a final match
                                      temp.push( (matcherIn[i] = elem) );
                                  }
          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 ( elem.id !== match[2] ) {
                                        return rootjQuery.find( selector );
                                    }
            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 ( Expr.relative[ tokens[j].type ] ) {
                                      break;
                                  }
              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 ( deleteExpando ) {
                                            delete elem[ internalKey ];
                
                                        } else if ( typeof elem.removeAttribute !== strundefined ) {
                                            elem.removeAttribute( internalKey );
                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 ( conv && s[ "throws" ] ) {
                                          response = conv( response );
                                      } else {
                                          try {
                                              response = conv( response );
                  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

                                    } else if ( copy !== undefined ) {
                                        target[ name ] = copy;
                                    }
                    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 ( matches[ sel ] ) {
                                                  matches.push( handleObj );
                                              }
                      Severity: Major
                      Found in docs/_build/html/_static/jquery-1.11.1.js - About 45 mins to fix

                        Function setMatcher has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                        Severity: Minor
                        Found in docs/_build/html/_static/jquery-1.11.1.js - About 45 mins to fix

                          Function init has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              init: function( elem, options, prop, end, easing, unit ) {
                          Severity: Minor
                          Found in docs/_build/html/_static/jquery-1.11.1.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    while ( j-- ) {
                                                        if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
                                                            elem.removeChild( tbody );
                                                        }
                                                    }
                            Severity: Major
                            Found in docs/_build/html/_static/jquery-1.11.1.js - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language