melphi/algobox

View on GitHub

Showing 14 of 255 total issues

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

    def test_should_get_frame_end_15m_infra_bar(self):
        expected = int(
            datetime(2016, 1, 12, 9, 14, 59, 999999).timestamp() * 1000.0)
        actual = TimestampUtil.get_frame_end(
            self._DEFAULT_TIMESTAMP_INFRA, StandardTimeFrame.M15)
Severity: Major
Found in python/algobox/src/tests/algobox/util/test_dateutil.py and 2 other locations - About 2 hrs to fix
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 43..48
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 50..55

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

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 test_should_get_frame_end_15m_at_open(self):
        expected = int(
            datetime(2016, 1, 12, 9, 14, 59, 999999).timestamp() * 1000.0)
        actual = TimestampUtil.get_frame_end(
            self._DEFAULT_TIMESTAMP_OPEN, StandardTimeFrame.M15)
Severity: Major
Found in python/algobox/src/tests/algobox/util/test_dateutil.py and 2 other locations - About 2 hrs to fix
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 36..41
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 50..55

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

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 test_should_get_frame_end_15m_at_close(self):
        expected = int(
            datetime(2016, 1, 12, 9, 14, 59, 999999).timestamp() * 1000.0)
        actual = TimestampUtil.get_frame_end(
            self._DEFAULT_TIMESTAMP_CLOSE, StandardTimeFrame.M15)
Severity: Major
Found in python/algobox/src/tests/algobox/util/test_dateutil.py and 2 other locations - About 2 hrs to fix
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 36..41
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 43..48

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

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 test_should_get_frame_start_15m_at_close(self):
        expected = int(
            datetime(2016, 1, 12, 9, 0, 0).timestamp() * 1000.0)
        actual = TimestampUtil.get_frame_start(
            self._DEFAULT_TIMESTAMP_CLOSE, StandardTimeFrame.M15)
Severity: Major
Found in python/algobox/src/tests/algobox/util/test_dateutil.py and 2 other locations - About 2 hrs to fix
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 15..20
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 22..27

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

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 test_should_get_frame_start_15m_at_open(self):
        expected = int(
            datetime(2016, 1, 12, 9, 0, 0).timestamp() * 1000.0)
        actual = TimestampUtil.get_frame_start(
            self._DEFAULT_TIMESTAMP_OPEN, StandardTimeFrame.M15)
Severity: Major
Found in python/algobox/src/tests/algobox/util/test_dateutil.py and 2 other locations - About 2 hrs to fix
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 15..20
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 29..34

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

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 test_should_get_frame_start_15m_infra_bar(self):
        expected = int(
            datetime(2016, 1, 12, 9, 0, 0).timestamp() * 1000.0)
        actual = TimestampUtil.get_frame_start(
            self._DEFAULT_TIMESTAMP_INFRA, StandardTimeFrame.M15)
Severity: Major
Found in python/algobox/src/tests/algobox/util/test_dateutil.py and 2 other locations - About 2 hrs to fix
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 22..27
python/algobox/src/tests/algobox/util/test_dateutil.py on lines 29..34

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

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 test_load_price_bars_date_numeric(self):
        price_feed = LocalFilePriceFeed(
            TestingConstants.DEFAULT_INSTRUMENT_ID_DAX,
            TestingConstants.FILE_SAMPLE_DAX_TICKS_NUMERIC_DATE)
        for price in price_feed.get_prices():
Severity: Major
Found in python/algobox/src/tests/algobox/price/test_pricefeed.py and 1 other location - About 1 hr to fix
python/algobox/src/tests/algobox/price/test_pricefeed.py on lines 8..15

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

    def test_load_price_bars_date_string(self):
        price_feed = LocalFilePriceFeed(
            TestingConstants.DEFAULT_INSTRUMENT_ID_DAX,
            TestingConstants.FILE_SAMPLE_DAX_TICKS)
        for price in price_feed.get_prices():
Severity: Major
Found in python/algobox/src/tests/algobox/price/test_pricefeed.py and 1 other location - About 1 hr to fix
python/algobox/src/tests/algobox/price/test_pricefeed.py on lines 17..24

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

    def __init__(self, instrument, time, ask, bid):
        self.instrument = instrument
        self.time = time
        self.ask = ask
        self.bid = bid
Severity: Major
Found in python/algobox/src/algobox/price/domain.py and 1 other location - About 1 hr to fix
python/algobox/src/algobox/price/domain.py on lines 9..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

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

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

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

Refactorings

Further Reading

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

    def __init__(self, open, high, low, close):
        self.open = open
        self.high = high
        self.low = low
        self.close = close
Severity: Major
Found in python/algobox/src/algobox/price/domain.py and 1 other location - About 1 hr to fix
python/algobox/src/algobox/price/domain.py on lines 39..43

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

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

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

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

Refactorings

Further Reading

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

        if instrument_id == TestingConstants.DEFAULT_INSTRUMENT_ID_DAX:
            assert from_timestamp == _TestingClientConstants \
                .DEFAULT_MARKET_HOURS_DAX.market_open
            assert to_timestamp == _TestingClientConstants \
                .DEFAULT_MARKET_HOURS_DAX.market_close
Severity: Minor
Found in python/algobox/src/tests/algobox/testing_client.py and 1 other location - About 50 mins to fix
python/algobox/src/tests/algobox/testing_client.py on lines 135..140

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

        elif instrument_id == TestingConstants.DEFAULT_INSTRUMENT_ID_EURUSD:
            assert from_timestamp == _TestingClientConstants \
                .DEFAULT_MARKET_HOURS_EURUSD.market_open
            assert to_timestamp == _TestingClientConstants \
                .DEFAULT_MARKET_HOURS_EURUSD.market_close
Severity: Minor
Found in python/algobox/src/tests/algobox/testing_client.py and 1 other location - About 50 mins to fix
python/algobox/src/tests/algobox/testing_client.py on lines 129..134

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

    def __str__(self):
        return '%s(instrument=%r, time=%r, ask=%r, bid=%r)' % \
               (self.__class__.__name__, self.instrument,
                self.time, self.ask, self.bid)
Severity: Minor
Found in python/algobox/src/algobox/price/domain.py and 1 other location - About 35 mins to fix
python/algobox/src/algobox/price/domain.py on lines 15..18

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

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 __str__(self):
        return '%s(open=%r, high=%r, low=%r, close=%r)' % \
               (self.__class__.__name__, self.open, self.high, self.low,
                self.close)
Severity: Minor
Found in python/algobox/src/algobox/price/domain.py and 1 other location - About 35 mins to fix
python/algobox/src/algobox/price/domain.py on lines 45..48

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

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