thundergolfer/mAIcroft

View on GitHub
maicroft/users/reddit_user.py

Summary

Maintainability
F
1 mo
Test Coverage

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

    Function process_submission has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def process_submission(self, submission):
            """
            Process a single submission.
    
            * Updates metrics
    Severity: Minor
    Found in maicroft/users/reddit_user.py - About 3 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 results has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def results(self):
            """
            Returns accumulated data as JSON.
    
            """
    Severity: Major
    Found in maicroft/users/reddit_user.py - About 3 hrs to fix

      Function derive_attributes has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def derive_attributes(self):
              """
              Derives attributes using activity data.
      
              """
      Severity: Minor
      Found in maicroft/users/reddit_user.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 __init__ has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def __init__(self, username, json_data=None):
              # Populate username and about data
              self.username = username
      
              self.comments = []
      Severity: Major
      Found in maicroft/users/reddit_user.py - About 2 hrs to fix

        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

        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

        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

        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

          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

            Function get_submissions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_submissions(self, limit=None):
                    """
                    Returns a list of redditor's submissions.
            
                    """
            Severity: Minor
            Found in maicroft/users/reddit_user.py - About 25 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 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

            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

            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

                    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

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

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

                        self.about = {
                            "created_utc": datetime.datetime.fromtimestamp(
                                data["about"]["created_utc"], tz=pytz.utc
                            ),
                            "link_karma": data["about"]["link_karma"],
            Severity: Major
            Found in maicroft/users/reddit_user.py and 1 other location - About 6 hrs to fix
            maicroft/users/twitter_user.py on lines 56..64

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

            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 (name, [comments, comment_karma]) in [
                        (s, [sum(x) for x in zip(*[(1, r[1]) for r in group])])
                            for s, group in groupby(
                                sorted(
                                    [
            Severity: Major
            Found in maicroft/users/reddit_user.py and 1 other location - About 6 hrs to fix
            maicroft/users/reddit_user.py on lines 929..936

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

            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 (name, [submissions, submission_karma]) in [
                        (s, [sum(x) for x in zip(*[(1, r[1]) for r in group])])
                            for s, group in groupby(
                                sorted(
                                    [
            Severity: Major
            Found in maicroft/users/reddit_user.py and 1 other location - About 6 hrs to fix
            maicroft/users/reddit_user.py on lines 876..883

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

            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

                    for i, d in enumerate(self.metrics["date"]):
                        if d["date"] == (
                            comment_timestamp.date().year,
                            comment_timestamp.date().month
                        ):
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 6 hrs to fix
            maicroft/activity_metrics_proc.py on lines 45..53
            maicroft/activity_metrics_proc.py on lines 102..110
            maicroft/users/reddit_user.py on lines 606..614

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

            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

                    for i, d in enumerate(self.metrics["date"]):
                        if d["date"] == (
                            submission_timestamp.date().year,
                            submission_timestamp.date().month
                        ):
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 6 hrs to fix
            maicroft/activity_metrics_proc.py on lines 45..53
            maicroft/activity_metrics_proc.py on lines 102..110
            maicroft/users/reddit_user.py on lines 525..533

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

            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 process_comments(self):
                    """
                    Process list of redditor's comments.
            
                    """
            Severity: Major
            Found in maicroft/users/reddit_user.py and 1 other location - About 5 hrs to fix
            maicroft/users/reddit_user.py on lines 467..483

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

            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 process_submissions(self):
                    """
                    Process list of redditor's submissions.
            
                    """
            Severity: Major
            Found in maicroft/users/reddit_user.py and 1 other location - About 5 hrs to fix
            maicroft/users/reddit_user.py on lines 449..465

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

            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

                    for i, w in enumerate(self.metrics["weekday"]):
                        if w["weekday"] == comment_timestamp.date().weekday():
                            w["comments"] += 1
                            w["comment_karma"] += comment.score
                            self.metrics["weekday"][i] = w
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 5 hrs to fix
            maicroft/activity_metrics_proc.py on lines 62..67
            maicroft/activity_metrics_proc.py on lines 119..124
            maicroft/users/reddit_user.py on lines 623..628

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

            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

                    for i, w in enumerate(self.metrics["weekday"]):
                        if w["weekday"] == submission_timestamp.date().weekday():
                            w["submissions"] += 1
                            w["submission_karma"] += submission.score
                            self.metrics["weekday"][i] = w
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 5 hrs to fix
            maicroft/activity_metrics_proc.py on lines 62..67
            maicroft/activity_metrics_proc.py on lines 119..124
            maicroft/users/reddit_user.py on lines 542..547

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

            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

                    for i, h in enumerate(self.metrics["hour"]):
                        if h["hour"] == comment_timestamp.hour:
                            h["comments"] += 1
                            h["comment_karma"] += comment.score
                            self.metrics["hour"][i] = h
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 5 hrs to fix
            maicroft/activity_metrics_proc.py on lines 55..60
            maicroft/activity_metrics_proc.py on lines 112..117
            maicroft/users/reddit_user.py on lines 616..621

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

            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

                    for i, h in enumerate(self.metrics["hour"]):
                        if h["hour"] == submission_timestamp.hour:
                            h["submissions"] += 1
                            h["submission_karma"] += submission.score
                            self.metrics["hour"][i] = h
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 5 hrs to fix
            maicroft/activity_metrics_proc.py on lines 55..60
            maicroft/activity_metrics_proc.py on lines 112..117
            maicroft/users/reddit_user.py on lines 535..540

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

            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

                    for value, count in Counter(
                        [value for value, source in self.orientations]
                    ).most_common(1):
                        sources = [s for v, s in self.orientations if v == value]
                        orientation.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 2 other locations - About 4 hrs to fix
            maicroft/users/reddit_user.py on lines 1101..1109
            maicroft/users/reddit_user.py on lines 1127..1135

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

            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

                    for value, count in Counter(
                        [value for value, source in self.relationship_partners]
                    ).most_common(1):
                        sources = [s for v, s in self.relationship_partners if v == value]
                        relationship_partner.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 2 other locations - About 4 hrs to fix
            maicroft/users/reddit_user.py on lines 1101..1109
            maicroft/users/reddit_user.py on lines 1114..1122

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

            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

                    for value, count in Counter(
                        [value for value, source in self.genders]
                    ).most_common(1):
                        sources = [s for v, s in self.genders if v == value]
                        gender.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 2 other locations - About 4 hrs to fix
            maicroft/users/reddit_user.py on lines 1114..1122
            maicroft/users/reddit_user.py on lines 1127..1135

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

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

                    for value, count in Counter(
                        [value for value, source in self.family_members]
                    ).most_common():
                        sources = [s for v, s in self.family_members if v == value]
                        family_members.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.possessions]
                    ).most_common():
                        sources = [s for v, s in self.possessions if v == value]
                        possessions.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.favorites]
                    ).most_common():
                        sources = [s for v, s in self.favorites if v == value]
                        favorites.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.places_lived]
                    ).most_common():
                        sources = [s for v, s in self.places_lived if v == value]
                        places_lived.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.actions]
                    ).most_common():
                        sources = [s for v, s in self.actions if v == value]
                        actions.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.places_grew_up]
                    ).most_common():
                        sources = [s for v, s in self.places_grew_up if v == value]
                        places_grew_up.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.actions_extra]
                    ).most_common():
                        sources = [s for v, s in self.actions_extra if v == value]
                        actions_extra.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291

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

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

                    for value, count in Counter(
                        [value for value, source in self.places_grew_up_extra]
                    ).most_common():
                        sources = [s for v, s in self.places_grew_up_extra if v == value]
                        places_grew_up_extra.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.attributes_extra]
                    ).most_common():
                        sources = [s for v, s in self.attributes_extra if v == value]
                        attributes_extra.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.attributes]
                    ).most_common():
                        sources = [s for v, s in self.attributes if v == value]
                        attributes.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.places_lived_extra]
                    ).most_common():
                        sources = [s for v, s in self.places_lived_extra if v == value]
                        places_lived_extra.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.pets]
                    ).most_common():
                        sources = [s for v, s in self.pets if v == value]
                        pets.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1270..1278
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

                    for value, count in Counter(
                        [value for value, source in self.possessions_extra]
                    ).most_common():
                        sources = [s for v, s in self.possessions_extra if v == value]
                        possessions_extra.append(
            Severity: Major
            Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
            maicroft/users/reddit_user.py on lines 1140..1148
            maicroft/users/reddit_user.py on lines 1153..1161
            maicroft/users/reddit_user.py on lines 1166..1174
            maicroft/users/reddit_user.py on lines 1179..1187
            maicroft/users/reddit_user.py on lines 1192..1200
            maicroft/users/reddit_user.py on lines 1205..1213
            maicroft/users/reddit_user.py on lines 1218..1226
            maicroft/users/reddit_user.py on lines 1231..1239
            maicroft/users/reddit_user.py on lines 1244..1252
            maicroft/users/reddit_user.py on lines 1257..1265
            maicroft/users/reddit_user.py on lines 1283..1291
            maicroft/users/reddit_user.py on lines 1296..1304

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

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

            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

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

                    if submission.score > self.best_submission.score:
                        self.best_submission = submission
                    elif submission.score < self.worst_submission.score:
                        self.worst_submission = submission
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 1 hr to fix
            maicroft/activity_metrics_proc.py on lines 69..72
            maicroft/activity_metrics_proc.py on lines 85..88
            maicroft/users/reddit_user.py on lines 549..552

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

            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 comment.score > self.best_comment.score:
                        self.best_comment = comment
                    elif comment.score < self.worst_comment.score:
                        self.worst_comment = comment
            Severity: Major
            Found in maicroft/users/reddit_user.py and 3 other locations - About 1 hr to fix
            maicroft/activity_metrics_proc.py on lines 69..72
            maicroft/activity_metrics_proc.py on lines 85..88
            maicroft/users/reddit_user.py on lines 665..668

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

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

                            sub_in_level1 = (
                                [
                                    s for s in level1["children"] if s["name"] == name
                                ] or [None]
            Severity: Major
            Found in maicroft/users/reddit_user.py and 4 other locations - About 1 hr to fix
            maicroft/social_info_extraction.py on lines 99..100
            maicroft/users/reddit_user.py on lines 653..655
            maicroft/users/reddit_user.py on lines 893..897
            maicroft/users/reddit_user.py on lines 945..949

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

            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 commented_subreddits(self):
                    """
                    Returns a list of subreddits redditor has commented on.
            
                    """
            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 801..809

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

            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 submitted_subreddits(self):
                    """
                    Returns a list of subreddits redditor has submitted to.
            
                    """
            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 789..797

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

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

                    d = (
                        [x for x in t["children"] if x["name"] == submission_domain] or
                        [None]
            Severity: Major
            Found in maicroft/users/reddit_user.py and 4 other locations - About 1 hr to fix
            maicroft/social_info_extraction.py on lines 99..100
            maicroft/users/reddit_user.py on lines 893..897
            maicroft/users/reddit_user.py on lines 945..949
            maicroft/users/reddit_user.py on lines 952..955

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

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

                        level1 = (
                            [
                                t for t in metrics_subreddit["children"]
                                if t["name"] == topic_level1
                            ] or [None]
            Severity: Major
            Found in maicroft/users/reddit_user.py and 4 other locations - About 1 hr to fix
            maicroft/social_info_extraction.py on lines 99..100
            maicroft/users/reddit_user.py on lines 653..655
            maicroft/users/reddit_user.py on lines 893..897
            maicroft/users/reddit_user.py on lines 952..955

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

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

                        level1 = (
                            [
                                t for t in metrics_subreddit["children"] \
                                    if t["name"] == topic_level1
                            ] or [None]
            Severity: Major
            Found in maicroft/users/reddit_user.py and 4 other locations - About 1 hr to fix
            maicroft/social_info_extraction.py on lines 99..100
            maicroft/users/reddit_user.py on lines 653..655
            maicroft/users/reddit_user.py on lines 945..949
            maicroft/users/reddit_user.py on lines 952..955

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

            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

                    t = [
                        x for x in self.submissions_by_type["children"]
                        if x["name"] == submission_type
            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 96..97

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

            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/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 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

                        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

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

                    if(submission.is_self):
                        text = Util.sanitize_text(submission.text)
                        self.corpus += text.lower()
            Severity: Minor
            Found in maicroft/users/reddit_user.py and 1 other location - About 30 mins to fix
            maicroft/social_info_extraction.py on lines 71..73

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

            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 not submission.is_self or not re.search(r"\b(i|my)\b", text, re.I):
                        return False
            Severity: Minor
            Found in maicroft/users/reddit_user.py and 1 other location - About 30 mins to fix
            maicroft/social_info_extraction.py on lines 117..118

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

            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

            There are no issues that match your filters.

            Category
            Status