thundergolfer/mAIcroft

View on GitHub

Showing 322 of 322 total issues

File jquery-1.11.1.js has 6829 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.11.1
 * http://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in docs/_build/html/_static/jquery-1.11.1.js - About 2 wks to fix

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

    def derive_attributes(user):
        """
        Derives attributes using activity data.
        """
    
    
    Severity: Major
    Found in maicroft/social_info_extraction.py and 1 other location - About 1 wk to fix
    maicroft/users/reddit_user.py on lines 691..787

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

    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

        def derive_attributes(self):
            """
            Derives attributes using activity data.
    
            """
    Severity: Major
    Found in maicroft/users/reddit_user.py and 1 other location - About 1 wk to fix
    maicroft/social_info_extraction.py on lines 349..446

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

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

    (function( window ) {
    
    var i,
        support,
        Expr,
    Severity: Major
    Found in docs/_build/html/_static/jquery-1.11.1.js - About 6 days to fix

      Function results has a Cognitive Complexity of 196 (exceeds 5 allowed). Consider refactoring.
      Open

          def results(self):
              """
              Returns accumulated data as JSON.
      
              """
      Severity: Minor
      Found in maicroft/users/reddit_user.py - About 4 days 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

      File reddit_user.py has 1379 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      from __future__ import print_function
      
      import calendar
      import datetime
      Severity: Major
      Found in maicroft/users/reddit_user.py - About 3 days to fix

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

                for comment in self.comments:
                    subreddit = subreddits_dict[comment.subreddit] \
                        if comment.subreddit in subreddits_dict else None
                    if subreddit and subreddit["topic_level1"] != "Other":
                        topic = subreddit["topic_level1"]
        Severity: Major
        Found in maicroft/users/reddit_user.py and 1 other location - About 1 day to fix
        maicroft/users/reddit_user.py on lines 1043..1058

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

        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 submission in self.submissions:
                    subreddit = subreddits_dict[submission.subreddit] \
                        if submission.subreddit in subreddits_dict else None
                    if subreddit and subreddit["topic_level1"] != "Other":
                        topic = subreddit["topic_level1"]
        Severity: Major
        Found in maicroft/users/reddit_user.py and 1 other location - About 1 day to fix
        maicroft/users/reddit_user.py on lines 1026..1041

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

        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

        File underscore-1.3.1.js has 665 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        //     Underscore.js 1.3.1
        //     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
        //     Underscore is freely distributable under the MIT license.
        //     Portions of Underscore are inspired or borrowed from Prototype,
        //     Oliver Steele's Functional, and John Resig's Micro-Templating.
        Severity: Major
        Found in docs/_build/html/_static/underscore-1.3.1.js - About 1 day to fix

          File websupport.js has 638 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * websupport.js
           * ~~~~~~~~~~~~~
           *
           * sphinx.websupport utilities for all documentation.
          Severity: Major
          Found in docs/_build/html/_static/websupport.js - About 1 day to fix

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

                if (submission_timestamp.date() - days_ago_60).days > 0:
                    user.metrics["heatmap"][
                        ((submission_timestamp.date() - days_ago_60).days-1) * 24 + submission_timestamp.hour
                    ] += 1
                    user.metrics["recent_karma"][
            Severity: Major
            Found in maicroft/activity_metrics_proc.py and 1 other location - About 1 day to fix
            maicroft/users/reddit_user.py on lines 594..603

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

            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 (submission_timestamp.date() - days_ago_60).days > 0:
                        self.metrics["heatmap"][
                            ((submission_timestamp.date() - days_ago_60).days-1)*24 +
                            submission_timestamp.hour
                        ] += 1
            Severity: Major
            Found in maicroft/users/reddit_user.py and 1 other location - About 1 day to fix
            maicroft/activity_metrics_proc.py on lines 91..99

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

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

                ajax: function( url, options ) {
            
                    // If url is an object, simulate pre-1.5 signature
                    if ( typeof url === "object" ) {
                        options = url;
            Severity: Major
            Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 day to fix

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

                      if (comment_timestamp.date() - days_ago_60).days > 0:
                          self.metrics["heatmap"][
                              (comment_timestamp.date() - days_ago_60).days*24 +
                              comment_timestamp.hour
                          ] += 1
              Severity: Major
              Found in maicroft/users/reddit_user.py and 1 other location - About 1 day to fix
              maicroft/activity_metrics_proc.py on lines 32..41

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

              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 (comment_timestamp.date() - days_ago_60).days > 0:
                      user.metrics["heatmap"][
                          (comment_timestamp.date() - days_ago_60).days*24 +
                          comment_timestamp.hour
                      ] += 1
              Severity: Major
              Found in maicroft/activity_metrics_proc.py and 1 other location - About 1 day to fix
              maicroft/users/reddit_user.py on lines 512..521

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

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

              var Stemmer = function() {
              
                var step2list = {
                  ational: 'ate',
                  tional: 'tion',
              Severity: Minor
              Found in docs/_build/html/_static/searchtools.js - About 1 day 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 setDocument has 216 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              setDocument = Sizzle.setDocument = function( node ) {
                  var hasCompare,
                      doc = node ? node.ownerDocument || node : preferredDoc,
                      parent = doc.defaultView;
              
              
              Severity: Major
              Found in docs/_build/html/_static/jquery-1.11.1.js - About 1 day to fix

                Function load_attributes has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                Open

                def load_attributes(user, chunk, post_permalink):
                    """
                    Given an extracted chunk, load appropriate attributes from it.
                
                    """
                Severity: Minor
                Found in maicroft/social_info_extraction.py - About 1 day 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

                    if submission.domain.startswith("user."):
                        submission_type = "Self"
                        submission_domain = submission.subreddit
                    elif (
                        submission_url_path.endswith(tuple(user.IMAGE_EXTENSIONS)) or
                Severity: Major
                Found in maicroft/social_info_extraction.py and 1 other location - About 7 hrs to fix
                maicroft/users/reddit_user.py on lines 634..648

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

                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 submission.domain.startswith("self."):
                            submission_type = "Self"
                            submission_domain = submission.subreddit
                        elif (
                            submission_url_path.endswith(tuple(self.IMAGE_EXTENSIONS)) or
                Severity: Major
                Found in maicroft/users/reddit_user.py and 1 other location - About 7 hrs to fix
                maicroft/social_info_extraction.py on lines 81..95

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

                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