unageanu/jiji2

View on GitHub
sample_agents/spec/trailing_stop_manager_spec.rb

Summary

Maintainability
C
1 day
Test Coverage

Block has too many lines. [285/25]
Open

describe TrailingStopManager do
  include_context 'use agent_setting'

  let(:builder)    { container.lookup(:position_builder) }
  let(:repository) { container.lookup(:position_repository) }

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [78/25]
Open

  it 'state/restore_stateで状態を復元できる' do
    notificator = create_notificator({
      message:  create_message('EURJPY/131.0/売',
        300.0,  Time.new(2015, 12, 11).to_s,
        -800.0, Time.new(2015, 12, 13).to_s),

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

File trailing_stop_manager_spec.rb has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'sample_agent_test_configuration'

describe TrailingStopManager do
  include_context 'use agent_setting'

Severity: Minor
Found in sample_agents/spec/trailing_stop_manager_spec.rb - About 2 hrs to fix

    Block has too many lines. [51/25]
    Open

      it 'warning_limitを下回ると、警告が送信される' do
        notificator = create_notificator({
          message:  create_message('EURJPY/131.0/売',
            300.0,  Time.new(2015, 12, 11).to_s,
            -800.0, Time.new(2015, 12, 13).to_s),

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [41/25]
    Open

      it 'closing_limitを下回ると、決済される' do
        notificator = create_notificator({
          message:  create_message('EURJPY/131.0/売',
            -300.0,  Time.new(2015, 12, 10).to_s,
            -1300.0, Time.new(2015, 12, 11).to_s),

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Method create_message has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def create_message(description, max_profit,
        max_profit_time, current_profit, last_update_time)
    Severity: Minor
    Found in sample_agents/spec/trailing_stop_manager_spec.rb - About 35 mins to fix

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

          notificator = create_notificator({
            message:  create_message('EURJPY/131.0/売',
              300.0,  Time.new(2015, 12, 11).to_s,
              -800.0, Time.new(2015, 12, 13).to_s),
            position: original[1]
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 1 other location - About 1 hr to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 184..199

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

      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

          notificator = create_notificator({
            message:  create_message('EURJPY/131.0/売',
              300.0,  Time.new(2015, 12, 11).to_s,
              -800.0, Time.new(2015, 12, 13).to_s),
            position: original[1]
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 1 other location - About 1 hr to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 69..84

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(130.8, 0.03),
            EURUSD: new_tick_value(1.0925, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 14)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.03, 0.03),
            EURUSD: new_tick_value(1.0940, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 12)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.03, 0.03),
            EURUSD: new_tick_value(1.0940, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 12)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.05, 0.03),
            EURUSD: new_tick_value(1.09301, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 13)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.06, 0.03),
            EURUSD: new_tick_value(1.0930, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 14)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.03, 0.03),
            EURUSD: new_tick_value(1.0935, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 13)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(130.94, 0.03),
            EURUSD: new_tick_value(1.0930, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 11)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.03, 0.03),
            EURUSD: new_tick_value(1.0940, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 12)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.20, 0.03),
            EURUSD: new_tick_value(1.0945, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 12)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.06, 0.03),
            EURUSD: new_tick_value(1.0930, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 14)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.10, 0.03),
            EURUSD: new_tick_value(1.0940, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 11)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(130.999, 0.03),
            EURUSD: new_tick_value(1.0940,  0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 13)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.05, 0.03),
            EURUSD: new_tick_value(1.09301, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 13)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(130.8, 0.03),
            EURUSD: new_tick_value(1.0925, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 18)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265

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

      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

        let(:pairs) do
          [
            Jiji::Model::Trading::Pair.new(
              :EURJPY, 'EUR_JPY', 0.01,   10_000_000, 0.001,   0.04),
            Jiji::Model::Trading::Pair.new(
      Severity: Minor
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 1 other location - About 15 mins to fix
      sample_agents/spec/range_break_checker_spec.rb on lines 8..14

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(131.20, 0.03),
            EURUSD: new_tick_value(1.0945, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 16)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(130.94, 0.03),
            EURUSD: new_tick_value(1.0930, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 11)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(130.999, 0.03),
            EURUSD: new_tick_value(1.0940,  0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 17)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(130.9,  0.03),
            EURUSD: new_tick_value(1.0932, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 15)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(130.94, 0.03),
            EURUSD: new_tick_value(1.0930, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 11)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 122..126
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

          positions.update_price(Jiji::Model::Trading::Tick.new({
            EURJPY: new_tick_value(130.9,  0.03),
            EURUSD: new_tick_value(1.0932, 0.00005),
            USDJPY: new_tick_value(0.9, 0.2)
          }, Time.new(2015, 12, 15)), pairs)
      Severity: Major
      Found in sample_agents/spec/trailing_stop_manager_spec.rb and 19 other locations - About 15 mins to fix
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 46..50
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 53..57
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 60..64
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 94..98
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 101..105
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 108..112
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 115..119
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 146..150
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 153..157
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 164..168
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 175..179
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 211..215
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 218..222
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 225..229
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 232..236
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 241..245
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 248..252
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 261..265
      sample_agents/spec/trailing_stop_manager_spec.rb on lines 272..276

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

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status