# holgern/beem

beem/amount.py

### Summary

F
1 wk
B
84%

#### Consider simplifying this complex logical expression. Open

``````        if amount and asset is None and isinstance(amount, Amount):
# Copy Asset object
self["amount"] = amount["amount"]
self["symbol"] = amount["symbol"]
self["asset"] = amount["asset"]``````
Found in beem/amount.py - About 1 day to fix

#### Cyclomatic complexity is too high in method __init__. (56) Open

``````    def __init__(self, amount, asset=None, fixed_point_arithmetic=False, new_appbase_format=True, blockchain_instance=None, **kwargs):
self["asset"] = {}
self.new_appbase_format = new_appbase_format
self.fixed_point_arithmetic = fixed_point_arithmetic
``````

## Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

#### File `amount.py` has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open

``````# -*- coding: utf-8 -*-
from beemgraphenebase.py23 import bytes_types, integer_types, string_types, text_type
from beem.instance import shared_blockchain_instance
from beem.asset import Asset
from decimal import Decimal, ROUND_DOWN``````
Found in beem/amount.py - About 4 hrs to fix

#### Function `__init__` has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open

``````    def __init__(self, amount, asset=None, fixed_point_arithmetic=False, new_appbase_format=True, blockchain_instance=None, **kwargs):
self["asset"] = {}
self.new_appbase_format = new_appbase_format
self.fixed_point_arithmetic = fixed_point_arithmetic
``````
Found in beem/amount.py - About 4 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"

#### `Amount` has 31 functions (exceeds 20 allowed). Consider refactoring. Open

``````class Amount(dict):
""" This class deals with Amounts of any asset to simplify dealing with the tuple::

(amount, asset)

``````
Found in beem/amount.py - About 3 hrs to fix

#### Cyclomatic complexity is too high in function check_asset. (7) Open

``````def check_asset(other, self, stm):
if isinstance(other, dict) and "asset" in other and isinstance(self, dict) and "asset" in self:
if not Asset(other["asset"], blockchain_instance=stm) == Asset(self["asset"], blockchain_instance=stm):
raise AssertionError()
else:``````

## Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

#### Function `__init__` has 6 arguments (exceeds 4 allowed). Consider refactoring. Open

``    def __init__(self, amount, asset=None, fixed_point_arithmetic=False, new_appbase_format=True, blockchain_instance=None, **kwargs):``
Found in beem/amount.py - About 45 mins to fix

#### Function `check_asset` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open

``````def check_asset(other, self, stm):
if isinstance(other, dict) and "asset" in other and isinstance(self, dict) and "asset" in self:
if not Asset(other["asset"], blockchain_instance=stm) == Asset(self["asset"], blockchain_instance=stm):
raise AssertionError()
else:``````
Found in beem/amount.py - About 35 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"

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

``````    def __div__(self, other):
from .price import Price
a = self.copy()
if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)``````
Found in beem/amount.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"

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

``````    def __mul__(self, other):
from .price import Price
a = self.copy()
if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)``````
Found in beem/amount.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"

#### Refactor this function to reduce its Cognitive Complexity from 36 to the 15 allowed. Open

``    def __init__(self, amount, asset=None, fixed_point_arithmetic=False, new_appbase_format=True, blockchain_instance=None, **kwargs):``
Found in beem/amount.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

## See

#### Either merge this branch with the identical one on line "126" or change one of the implementations. Open

``````            self["amount"] = amount
self["asset"] = asset
self["symbol"] = self["asset"]["symbol"]            ``````
Found in beem/amount.py by sonar-python

Having two branches in the same `if` structure with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then they should be combined.

## Noncompliant Code Example

```if 0 <= a < 10:
do_the_thing()
elif 10 <= a < 20:
do_the_other_thing()
elif 20 <= a < 50:
do_the_thing()  # Noncompliant; duplicates first condition
else:
do_the_rest()

b = 4 if a > 12 else 4
```

## Compliant Solution

```if (0 <= a < 10) or (20 <= a < 50):
do_the_thing()
elif 10 <= a < 20:
do_the_other_thing()
else:
do_the_rest()

b = 4
```

or

```if 0 <= a < 10:
do_the_thing()
elif 10 <= a < 20:
do_the_other_thing()
elif 20 <= a < 50:
do_the_third_thing()
else:
do_the_rest()

b = 8 if a > 12 else 4
```

#### Either merge this branch with the identical one on line "121" or change one of the implementations. Open

``````            self["amount"] = str(amount)
self["asset"] = asset
self["symbol"] = self["asset"]["symbol"]``````
Found in beem/amount.py by sonar-python

Having two branches in the same `if` structure with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then they should be combined.

## Noncompliant Code Example

```if 0 <= a < 10:
do_the_thing()
elif 10 <= a < 20:
do_the_other_thing()
elif 20 <= a < 50:
do_the_thing()  # Noncompliant; duplicates first condition
else:
do_the_rest()

b = 4 if a > 12 else 4
```

## Compliant Solution

```if (0 <= a < 10) or (20 <= a < 50):
do_the_thing()
elif 10 <= a < 20:
do_the_other_thing()
else:
do_the_rest()

b = 4
```

or

```if 0 <= a < 10:
do_the_thing()
elif 10 <= a < 20:
do_the_other_thing()
elif 20 <= a < 50:
do_the_third_thing()
else:
do_the_rest()

b = 8 if a > 12 else 4
```

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

``````def check_asset(other, self, stm):
if isinstance(other, dict) and "asset" in other and isinstance(self, dict) and "asset" in self:
if not Asset(other["asset"], blockchain_instance=stm) == Asset(self["asset"], blockchain_instance=stm):
raise AssertionError()
else:``````
Found in beem/amount.py and 1 other location - About 6 hrs to fix
beem/price.py on lines 14..20

## 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 108.

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

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

``````        elif (amount and asset is None and isinstance(amount, dict) and "amount" in amount and "asset_id" in amount):
self["asset"] = Asset(amount["asset_id"], blockchain_instance=self.blockchain)
self["symbol"] = self["asset"]["symbol"]
self["amount"] = Decimal(amount["amount"]) / Decimal(10 ** self["asset"]["precision"])``````
Found in beem/amount.py and 1 other location - About 6 hrs to fix
beem/amount.py on lines 115..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 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

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

``````        elif (amount and asset is None and isinstance(amount, dict) and "amount" in amount and "asset" in amount):
self["asset"] = Asset(amount["asset"], blockchain_instance=self.blockchain)
self["symbol"] = self["asset"]["symbol"]
self["amount"] = Decimal(amount["amount"]) / Decimal(10 ** self["asset"]["precision"])``````
Found in beem/amount.py and 1 other location - About 6 hrs to fix
beem/amount.py on lines 110..113

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

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

``````        if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)
self["amount"] %= other["amount"]
else:
self["amount"] %= Decimal(other)``````
Found in beem/amount.py and 1 other location - About 3 hrs to fix
beem/amount.py on lines 304..308

## 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 69.

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

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

``````        if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)
self["amount"] += other["amount"]
else:
self["amount"] += Decimal(other)``````
Found in beem/amount.py and 1 other location - About 3 hrs to fix
beem/amount.py on lines 233..237

## 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 69.

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

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

``````        if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)
a["amount"] %= other["amount"]
else:
a["amount"] %= Decimal(other)``````
Found in beem/amount.py and 1 other location - About 3 hrs to fix
beem/amount.py on lines 373..377

## 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 69.

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

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

``````        if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)
a["amount"] += other["amount"]
else:
a["amount"] += Decimal(other)``````
Found in beem/amount.py and 1 other location - About 3 hrs to fix
beem/amount.py on lines 325..329

## 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 69.

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

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

``````        if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)
a["amount"] -= other["amount"]
else:
a["amount"] -= Decimal(other)``````
Found in beem/amount.py and 1 other location - About 3 hrs to fix
beem/amount.py on lines 335..339

## 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 69.

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

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

``````        if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)
self["amount"] -= other["amount"]
else:
self["amount"] -= Decimal(other)``````
Found in beem/amount.py and 1 other location - About 3 hrs to fix
beem/amount.py on lines 244..248

## 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 69.

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

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

``````        elif isinstance(amount, (float)) and asset and isinstance(asset, Asset):
self["amount"] = str(amount)
self["asset"] = asset
self["symbol"] = self["asset"]["symbol"]``````
Found in beem/amount.py and 1 other location - About 2 hrs to fix
beem/amount.py on lines 130..133

## 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 50.

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

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

``````        elif isinstance(amount, (float)) and asset and isinstance(asset, dict):
self["amount"] = str(amount)
self["asset"] = asset
self["symbol"] = self["asset"]["symbol"]``````
Found in beem/amount.py and 1 other location - About 2 hrs to fix
beem/amount.py on lines 120..123

## 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 50.

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

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

``````        elif isinstance(amount, (integer_types,  Decimal)) and asset and isinstance(asset, Asset):
self["amount"] = amount
self["asset"] = asset
self["symbol"] = self["asset"]["symbol"]``````
Found in beem/amount.py and 1 other location - About 1 hr to fix
beem/amount.py on lines 135..138

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

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

``````        elif isinstance(amount, (integer_types, Decimal)) and asset and isinstance(asset, dict):
self["amount"] = amount
self["asset"] = asset
self["symbol"] = self["asset"]["symbol"]            ``````
Found in beem/amount.py and 1 other location - About 1 hr to fix
beem/amount.py on lines 125..128

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

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

``````        if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)
a["amount"] *= other["amount"]``````
Found in beem/amount.py and 1 other location - About 1 hr to fix
beem/amount.py on lines 345..347

## 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 43.

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

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

``````        if isinstance(other, Amount):
check_asset(other["asset"], self["asset"], self.blockchain)
self["amount"] *= other["amount"]``````
Found in beem/amount.py and 1 other location - About 1 hr to fix
beem/amount.py on lines 256..258

## 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 43.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
a["amount"] = quantize(a["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
self["amount"] = quantize(self["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
a["amount"] = quantize(a["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
a["amount"] = quantize(a["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
self["amount"] = quantize(self["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
self["amount"] = quantize(self["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
self["amount"] = quantize(self["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
a["amount"] = quantize(a["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
a["amount"] = quantize(a["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
a["amount"] = quantize(a["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
a["amount"] = quantize(a["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379
beem/amount.py on lines 387..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 40.

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

#### Similar blocks of code found in 12 locations. Consider refactoring. Open

``````        if self.fixed_point_arithmetic:
self["amount"] = quantize(self["amount"], self["asset"]["precision"])``````
Found in beem/amount.py and 11 other locations - About 1 hr to fix
beem/amount.py on lines 238..239
beem/amount.py on lines 249..250
beem/amount.py on lines 267..268
beem/amount.py on lines 279..280
beem/amount.py on lines 298..299
beem/amount.py on lines 309..310
beem/amount.py on lines 320..321
beem/amount.py on lines 330..331
beem/amount.py on lines 340..341
beem/amount.py on lines 360..361
beem/amount.py on lines 378..379

## 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 40.

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

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

``````            if not self["asset"] == other["quote"]["asset"]:
raise AssertionError()``````
Found in beem/amount.py and 1 other location - About 55 mins to fix
beem/amount.py on lines 290..291

## Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

## Tuning

This issue has a mass of 37.

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

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

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

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

## Refactorings

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

``````            if not self["asset"] == other["base"]["asset"]:
raise AssertionError()``````
Found in beem/amount.py and 1 other location - About 55 mins to fix
beem/amount.py on lines 260..261

## Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

## Tuning

This issue has a mass of 37.

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

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

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

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