thundergolfer/mAIcroft

View on GitHub

Showing 322 of 322 total issues

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

        if d:
            d["size"] += 1
        else:
            t["children"].append({
                "name": submission_domain,
Severity: Major
Found in maicroft/users/reddit_user.py and 1 other location - About 1 hr to fix
maicroft/social_info_extraction.py on lines 102..107

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

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 d:
        d["size"] += 1
    else:
        t["children"].append({
            "name": submission_domain,
Severity: Major
Found in maicroft/social_info_extraction.py and 1 other location - About 1 hr to fix
maicroft/users/reddit_user.py on lines 657..662

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

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

function propFilter( props, specialEasing ) {
    var index, name, easing, value, hooks;

    // camelCase, specialEasing and expand cssHook pass
    for ( index in props ) {
Severity: Minor
Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

    Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            setup: function() {
    
                if ( rformElems.test( this.nodeName ) ) {
                    // IE doesn't fire change on a check/radio until blur; trigger it on click
                    // after a propertychange. Eat the blur-change in special.change.handle.
    Severity: Minor
    Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

      Function getComments has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function getComments(id) {
          $.ajax({
           type: 'GET',
           url: opts.getCommentsURL,
           data: {node: id},
      Severity: Minor
      Found in docs/_build/html/_static/websupport.js - About 1 hr to fix

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

                if ( jQuery.isFunction( html ) ) {
                    return this.each(function(i) {
                        jQuery(this).wrapInner( html.call(this, i) );
                    });
                }
        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 9354..9358

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

        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 ( jQuery.isFunction( html ) ) {
                    return this.each(function(i) {
                        jQuery(this).wrapAll( html.call(this, i) );
                    });
                }
        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 9383..9387

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

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

            off: function( types, selector, fn ) {
                var handleObj, type;
                if ( types && types.preventDefault && types.handleObj ) {
                    // ( event )  dispatched jQuery.Event
                    handleObj = types.handleObj;
        Severity: Minor
        Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

          Function * has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  "*": [ function( prop, value ) {
                      var tween = this.createTween( prop, value ),
                          target = tween.cur(),
                          parts = rfxnum.exec( value ),
                          unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
          Severity: Minor
          Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

            Function offset has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                offset: function( options ) {
                    if ( arguments.length ) {
                        return options === undefined ?
                            this :
                            this.each(function( i ) {
            Severity: Minor
            Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                              support.getById && 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/_build/html/_static/jquery-1.11.1.js - About 1 hr to fix

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

                            if subreddit and subreddit["topic_level1"] != "Other":
                                topic_level1 = subreddit["topic_level1"]
                            else:
                                topic_level1 = "Other"
                Severity: Major
                Found in maicroft/users/reddit_user.py and 1 other location - About 1 hr to fix
                maicroft/users/reddit_user.py on lines 888..891

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

                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

                        self.metrics["hour"] = [
                            {
                                "hour": hour,
                                "comments": 0,
                                "submissions": 0,
                Severity: Major
                Found in maicroft/users/reddit_user.py and 1 other location - About 1 hr to fix
                maicroft/users/reddit_user.py on lines 224..231

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

                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

                        self.metrics["weekday"] = [
                            {
                                "weekday": weekday,
                                "comments": 0,
                                "submissions": 0,
                Severity: Major
                Found in maicroft/users/reddit_user.py and 1 other location - About 1 hr to fix
                maicroft/users/reddit_user.py on lines 214..221

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

                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 subreddit and subreddit["topic_level1"] != "Other":
                                topic_level1 = subreddit["topic_level1"]
                            else:
                                topic_level1 = "Other"
                Severity: Major
                Found in maicroft/users/reddit_user.py and 1 other location - About 1 hr to fix
                maicroft/users/reddit_user.py on lines 941..944

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

                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

                        "even": createPositionalPseudo(function( matchIndexes, length ) {
                            var i = 0;
                            for ( ; i < length; i += 2 ) {
                                matchIndexes.push( i );
                            }
                Severity: Minor
                Found in docs/_build/html/_static/jquery-1.11.1.js and 1 other location - About 55 mins to fix
                docs/_build/html/_static/jquery-1.11.1.js on lines 1984..1990

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

                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

                        "odd": createPositionalPseudo(function( matchIndexes, length ) {
                            var i = 1;
                            for ( ; i < length; i += 2 ) {
                                matchIndexes.push( i );
                            }
                Severity: Minor
                Found in docs/_build/html/_static/jquery-1.11.1.js and 1 other location - About 55 mins to fix
                docs/_build/html/_static/jquery-1.11.1.js on lines 1976..1982

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

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

                    def get_comments(self, limit=None):
                        """
                        Returns a list of redditor's comments.
                
                        """
                Severity: Minor
                Found in maicroft/users/reddit_user.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 relationship_partner(self, word):
                        """
                        Returns word if word is in a predefined list of relationship partners.
                        """
                        word = word.lower()
                Severity: Major
                Found in maicroft/text_parser.py and 2 other locations - About 55 mins to fix
                maicroft/text_parser.py on lines 128..138
                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

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

                    def orientation(self, word):
                        """
                        Returns word if word is in a predefined list of sexual orientations.
                
                        """
                Severity: Major
                Found in maicroft/text_parser.py and 2 other locations - About 55 mins to fix
                maicroft/text_parser.py on lines 128..138
                maicroft/text_parser.py on lines 157..165

                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

                Severity
                Category
                Status
                Source
                Language