thundergolfer/mAIcroft

View on GitHub

Showing 322 of 322 total issues

Function process_action has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def process_action(self, phrase):
        """
        Given a phrase, checks and returns an action
        (I <verb-phrase>) if exists.
        """
Severity: Minor
Found in maicroft/text_parser.py - 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 remove has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    remove: function( elem, types, handler, selector, mappedTypes ) {
        var j, handleObj, tmp,
            origCount, t, events,
            special, handlers, type,
            namespaces, origType,
Severity: Major
Found in docs/_build/html/_static/jquery-1.11.1.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                    if ( ( mappedTypes || origType === handleObj.origType ) &&
                        ( !handler || handler.guid === handleObj.guid ) &&
                        ( !tmp || tmp.test( handleObj.namespace ) ) &&
                        ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
                        handlers.splice( j, 1 );
    Severity: Critical
    Found in docs/_build/html/_static/jquery-1.11.1.js - About 2 hrs to fix

      Function performObjectSearch has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        performObjectSearch : function(object, otherterms) {
          var filenames = this._index.filenames;
          var objects = this._index.objects;
          var objnames = this._index.objnames;
          var titles = this._index.titles;
      Severity: Minor
      Found in docs/_build/html/_static/searchtools.js - About 2 hrs to fix

        Function internalRemoveData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function internalRemoveData( elem, name, pvt ) {
            if ( !jQuery.acceptData( elem ) ) {
                return;
            }
        
        
        Severity: Minor
        Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

          Function initEvents has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function initEvents() {
              $(document).on("click", 'a.comment-close', function(event) {
                event.preventDefault();
                hide($(this).attr('id').substring(2));
              });
          Severity: Minor
          Found in docs/_build/html/_static/websupport.js - About 1 hr to fix

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

                    if possessions_extra:
                        if "possessions" in synopsis:
                            synopsis["possessions"].update(
                                {
                                    "data_extra": possessions_extra
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 1 hr to fix
            maicroft/users/reddit_user.py on lines 1330..1338
            maicroft/users/reddit_user.py on lines 1347..1355
            maicroft/users/reddit_user.py on lines 1379..1387

            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

            Function process_comment has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                def process_comment(self, comment):
                    """
                    Process a single comment.
            
                    * Updates metrics
            Severity: Minor
            Found in maicroft/users/reddit_user.py - About 1 hr 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 4 locations. Consider refactoring.
            Open

                    if places_lived_extra:
                        if "places_lived" in synopsis:
                            synopsis["places_lived"].update(
                                {
                                    "data_extra": places_lived_extra
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 1 hr to fix
            maicroft/users/reddit_user.py on lines 1347..1355
            maicroft/users/reddit_user.py on lines 1379..1387
            maicroft/users/reddit_user.py on lines 1396..1404

            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 4 locations. Consider refactoring.
            Open

                    if places_grew_up_extra:
                        if "places_grew_up" in synopsis:
                            synopsis["places_grew_up"].update(
                                {
                                    "data_extra": places_grew_up_extra
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 1 hr to fix
            maicroft/users/reddit_user.py on lines 1330..1338
            maicroft/users/reddit_user.py on lines 1379..1387
            maicroft/users/reddit_user.py on lines 1396..1404

            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 4 locations. Consider refactoring.
            Open

                    if attributes_extra:
                        if "attributes" in synopsis:
                            synopsis["attributes"].update(
                                {
                                    "data_extra": attributes_extra
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 1 hr to fix
            maicroft/users/reddit_user.py on lines 1330..1338
            maicroft/users/reddit_user.py on lines 1347..1355
            maicroft/users/reddit_user.py on lines 1396..1404

            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

            Function select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            select = Sizzle.select = function( selector, context, results, seed ) {
                var i, tokens, token, type, find,
                    compiled = typeof selector === "function" && selector,
                    match = !seed && tokenize( (selector = compiled.selector || selector) );
            
            
            Severity: Minor
            Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

              Function internalData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
                  if ( !jQuery.acceptData( elem ) ) {
                      return;
                  }
              
              
              Severity: Minor
              Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

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

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

                  Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                      var matched, match, tokens, type,
                          soFar, groups, preFilters,
                          cached = tokenCache[ selector + " " ];
                  
                  
                  Severity: Minor
                  Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

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

                                if any(
                                    p in ["in", "near", "by"] for p in prepositions
                                ) and proper_nouns:
                                    user.places_grew_up.append(
                                        (
                    Severity: Major
                    Found in maicroft/social_info_extraction.py and 1 other location - About 1 hr to fix
                    maicroft/social_info_extraction.py on lines 317..334

                    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

                                    event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
                    Severity: Major
                    Found in docs/_build/html/_static/jquery-1.11.1.js and 1 other location - About 1 hr to fix
                    docs/_build/html/_static/jquery-1.11.1.js on lines 4787..4787

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

                    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

                                    event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
                    Severity: Major
                    Found in docs/_build/html/_static/jquery-1.11.1.js and 1 other location - About 1 hr to fix
                    docs/_build/html/_static/jquery-1.11.1.js on lines 4788..4788

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

                    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 addComment has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function addComment(form) {
                        var node_id = form.find('input[name="node"]').val();
                        var parent_id = form.find('input[name="parent"]').val();
                        var text = form.find('textarea[name="comment"]').val();
                        var proposal = form.find('textarea[name="proposal"]').val();
                    Severity: Minor
                    Found in docs/_build/html/_static/websupport.js - About 1 hr to fix

                      Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function matcherFromTokens( tokens ) {
                          var checkContext, matcher, j,
                              len = tokens.length,
                              leadingRelative = Expr.relative[ tokens[0].type ],
                              implicitRelative = leadingRelative || Expr.relative[" "],
                      Severity: Minor
                      Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language