holgern/beem

View on GitHub

Showing 2,332 of 2,332 total issues

File cli.py has 4836 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
import os
import ast
import json
import sys
Severity: Major
Found in beem/cli.py - About 2 wks to fix

    File account.py has 3323 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    import pytz
    import json
    from datetime import datetime, timedelta, date, time
    import math
    Severity: Major
    Found in beem/account.py - About 1 wk to fix

      File blockchaininstance.py has 1891 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      import json
      import logging
      import re
      import os
      Severity: Major
      Found in beem/blockchaininstance.py - About 5 days to fix

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

            def __init__(self, sort, account, observer="", limit=20, start_author="", start_permlink="", lazy=False, full=True, raw_data=False, blockchain_instance=None, **kwargs):
                if blockchain_instance is None:
                    if kwargs.get("steem_instance"):
                        blockchain_instance = kwargs["steem_instance"]
                    elif kwargs.get("hive_instance"):
        Severity: Major
        Found in beem/comment.py and 1 other location - About 4 days to fix
        beem/comment.py on lines 897..933

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

        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 __init__(self, sort, tag="", observer="", limit=21, start_author="", start_permlink="", lazy=False, full=True, raw_data=False, blockchain_instance=None, **kwargs):
                if blockchain_instance is None:
                    if kwargs.get("steem_instance"):
                        blockchain_instance = kwargs["steem_instance"]
                    elif kwargs.get("hive_instance"):
        Severity: Major
        Found in beem/comment.py and 1 other location - About 4 days to fix
        beem/comment.py on lines 947..983

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

            def rshares_to_vote_pct(self, rshares, post_rshares=0, steem_power=None, vests=None, voting_power=STEEM_100_PERCENT, use_stored_data=True):
                """ Obtain the voting percentage for a desired rshares value
                    for a given Steem Power or vesting shares and voting_power
                    Give either steem_power or vests, not both.
                    When the output is greater than 10000 or less than -10000,
        Severity: Major
        Found in beem/steem.py and 2 other locations - About 4 days to fix
        beem/blurt.py on lines 338..378
        beem/hive.py on lines 329..369

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

            def rshares_to_vote_pct(self, rshares, post_rshares=0, steem_power=None, vests=None, voting_power=STEEM_100_PERCENT, use_stored_data=True):
                """ Obtain the voting percentage for a desired rshares value
                    for a given Steem Power or vesting shares and voting_power
                    Give either steem_power or vests, not both.
                    When the output is greater than 10000 or less than -10000,
        Severity: Major
        Found in beem/blurt.py and 2 other locations - About 4 days to fix
        beem/hive.py on lines 329..369
        beem/steem.py on lines 348..388

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

            def rshares_to_vote_pct(self, rshares, post_rshares=0, hive_power=None, vests=None, voting_power=STEEM_100_PERCENT, use_stored_data=True):
                """ Obtain the voting percentage for a desired rshares value
                    for a given Hive Power or vesting shares and voting_power
                    Give either hive_power or vests, not both.
                    When the output is greater than 10000 or less than -10000,
        Severity: Major
        Found in beem/hive.py and 2 other locations - About 4 days to fix
        beem/blurt.py on lines 338..378
        beem/steem.py on lines 348..388

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function blocks has a Cognitive Complexity of 171 (exceeds 5 allowed). Consider refactoring.
        Open

            def blocks(self, start=None, stop=None, max_batch_size=None, threading=False, thread_num=8, only_ops=False, only_virtual_ops=False):
                """ Yields blocks starting from ``start``.
        
                    :param int start: Starting block
                    :param int stop: Stop at this block
        Severity: Minor
        Found in beem/blockchain.py - About 3 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

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

                if password:
                    active_key = PasswordKey(account_name, password, role="active", prefix=self.prefix)
                    owner_key = PasswordKey(account_name, password, role="owner", prefix=self.prefix)
                    posting_key = PasswordKey(account_name, password, role="posting", prefix=self.prefix)
                    memo_key = PasswordKey(account_name, password, role="memo", prefix=self.prefix)
        Severity: Major
        Found in beem/blockchaininstance.py and 1 other location - About 3 days to fix
        beem/blockchaininstance.py on lines 1371..1405

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

        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 password:
                    active_key = PasswordKey(account_name, password, role="active", prefix=self.prefix)
                    owner_key = PasswordKey(account_name, password, role="owner", prefix=self.prefix)
                    posting_key = PasswordKey(account_name, password, role="posting", prefix=self.prefix)
                    memo_key = PasswordKey(account_name, password, role="memo", prefix=self.prefix)
        Severity: Major
        Found in beem/blockchaininstance.py and 1 other location - About 3 days to fix
        beem/blockchaininstance.py on lines 1174..1208

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

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

        class Discussions_by_children(list):
            """ Get discussions by children
        
                :param Query discussion_query: Defines the parameter
                    searching posts
        Severity: Major
        Found in beem/discussions.py and 8 other locations - About 2 days to fix
        beem/discussions.py on lines 296..341
        beem/discussions.py on lines 347..392
        beem/discussions.py on lines 398..443
        beem/discussions.py on lines 449..494
        beem/discussions.py on lines 500..546
        beem/discussions.py on lines 552..597
        beem/discussions.py on lines 654..699
        beem/discussions.py on lines 870..915

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

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

        class Discussions_by_cashout(list):
            """ Get discussions_by_cashout. This query seems to be broken at the moment.
                The output is always empty.
        
                :param Query discussion_query: Defines the parameter
        Severity: Major
        Found in beem/discussions.py and 8 other locations - About 2 days to fix
        beem/discussions.py on lines 296..341
        beem/discussions.py on lines 347..392
        beem/discussions.py on lines 398..443
        beem/discussions.py on lines 449..494
        beem/discussions.py on lines 552..597
        beem/discussions.py on lines 603..648
        beem/discussions.py on lines 654..699
        beem/discussions.py on lines 870..915

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

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

        class Discussions_by_hot(list):
            """ Get discussions by hot
        
                :param Query discussion_query: Defines the parameter
                    searching posts
        Severity: Major
        Found in beem/discussions.py and 8 other locations - About 2 days to fix
        beem/discussions.py on lines 296..341
        beem/discussions.py on lines 347..392
        beem/discussions.py on lines 398..443
        beem/discussions.py on lines 449..494
        beem/discussions.py on lines 500..546
        beem/discussions.py on lines 552..597
        beem/discussions.py on lines 603..648
        beem/discussions.py on lines 870..915

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

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

        class Discussions_by_promoted(list):
            """ Get discussions by promoted
        
                :param Query discussion_query: Defines the parameter
                    searching posts
        Severity: Major
        Found in beem/discussions.py and 8 other locations - About 2 days to fix
        beem/discussions.py on lines 296..341
        beem/discussions.py on lines 347..392
        beem/discussions.py on lines 398..443
        beem/discussions.py on lines 449..494
        beem/discussions.py on lines 500..546
        beem/discussions.py on lines 552..597
        beem/discussions.py on lines 603..648
        beem/discussions.py on lines 654..699

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

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

        class Post_discussions_by_payout(list):
            """ Get post_discussions_by_payout
        
                :param Query discussion_query: Defines the parameter for
                    searching posts
        Severity: Major
        Found in beem/discussions.py and 8 other locations - About 2 days to fix
        beem/discussions.py on lines 296..341
        beem/discussions.py on lines 398..443
        beem/discussions.py on lines 449..494
        beem/discussions.py on lines 500..546
        beem/discussions.py on lines 552..597
        beem/discussions.py on lines 603..648
        beem/discussions.py on lines 654..699
        beem/discussions.py on lines 870..915

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

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

        class Discussions_by_created(list):
            """ Get discussions_by_created
        
                :param Query discussion_query: Defines the parameter for
                    searching posts
        Severity: Major
        Found in beem/discussions.py and 8 other locations - About 2 days to fix
        beem/discussions.py on lines 296..341
        beem/discussions.py on lines 347..392
        beem/discussions.py on lines 449..494
        beem/discussions.py on lines 500..546
        beem/discussions.py on lines 552..597
        beem/discussions.py on lines 603..648
        beem/discussions.py on lines 654..699
        beem/discussions.py on lines 870..915

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

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

        class Comment_discussions_by_payout(list):
            """ Get comment_discussions_by_payout
        
                :param Query discussion_query: Defines the parameter for
                    searching posts
        Severity: Major
        Found in beem/discussions.py and 8 other locations - About 2 days to fix
        beem/discussions.py on lines 347..392
        beem/discussions.py on lines 398..443
        beem/discussions.py on lines 449..494
        beem/discussions.py on lines 500..546
        beem/discussions.py on lines 552..597
        beem/discussions.py on lines 603..648
        beem/discussions.py on lines 654..699
        beem/discussions.py on lines 870..915

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

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

        class Discussions_by_votes(list):
            """ Get discussions_by_votes
        
                :param Query discussion_query: Defines the parameter
                    searching posts
        Severity: Major
        Found in beem/discussions.py and 8 other locations - About 2 days to fix
        beem/discussions.py on lines 296..341
        beem/discussions.py on lines 347..392
        beem/discussions.py on lines 398..443
        beem/discussions.py on lines 449..494
        beem/discussions.py on lines 500..546
        beem/discussions.py on lines 603..648
        beem/discussions.py on lines 654..699
        beem/discussions.py on lines 870..915

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

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

        class Discussions_by_active(list):
            """ get_discussions_by_active
        
                :param Query discussion_query: Defines the parameter
                    searching posts
        Severity: Major
        Found in beem/discussions.py and 8 other locations - About 2 days to fix
        beem/discussions.py on lines 296..341
        beem/discussions.py on lines 347..392
        beem/discussions.py on lines 398..443
        beem/discussions.py on lines 500..546
        beem/discussions.py on lines 552..597
        beem/discussions.py on lines 603..648
        beem/discussions.py on lines 654..699
        beem/discussions.py on lines 870..915

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language