unageanu/jiji2

View on GitHub

Showing 122 of 840 total issues

File trap_repeat_if_done_spec.rb has 599 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'sample_agent_test_configuration'

describe TrapRepeatIfDone do
  include_context 'use agent_setting'

Severity: Major
Found in sample_agents/spec/trap_repeat_if_done_spec.rb - About 1 day to fix

    File range_break_checker_spec.rb has 350 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'sample_agent_test_configuration'
    
    describe RangeBreakChecker do
      include_context 'use agent_setting'
    
    
    Severity: Minor
    Found in sample_agents/spec/range_break_checker_spec.rb - About 4 hrs to fix

      Function createContnet has 103 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        createContnet() {
          const summary = this.state.summary;
          if (!summary) {
            return <div className="center-information loading">
              <LoadingImage left={-20}/>
      Severity: Major
      Found in sites/src/js/view/components/trading-summary/trading-summary-view.js - About 4 hrs to fix

        CoordinateCalculator has 32 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export default class CoordinateCalculator extends Observable {
        
          constructor() {
            super();
          }
        Severity: Minor
        Found in sites/src/js/viewmodel/chart/coordinate-calculator.js - About 4 hrs to fix

          Function render has 98 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              if (this.state.loading) {
                return <div className="backtest-builder center-information loading">
                  <LoadingImage left={-20}/>
                </div>;
          Severity: Major
          Found in sites/src/js/view/components/backtests/backtest-builder.js - About 3 hrs to fix

            File cointegration_trader_spec.rb has 330 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'sample_agent_test_configuration'
            require 'statistical_arbitrage/shared_context'
            
            describe StatisticalArbitrage::CointegrationTrader do
              include_context 'utils for statistical arbitrage'
            Severity: Minor
            Found in sample_agents/spec/statistical_arbitrage/cointegration_trader_spec.rb - About 3 hrs to fix

              File statistical_arbitrage_agent.rb has 329 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'quandl'
              require 'lru_redux'
              
              # === 統計的裁定取引エージェント
              class StatisticalArbitrageAgent
              Severity: Minor
              Found in sample_agents/src/statistical_arbitrage_agent.rb - About 3 hrs to fix

                Slider has 31 functions (exceeds 20 allowed). Consider refactoring.
                Open

                export default class Slider extends Observable {
                
                  constructor(context, coordinateCalculator, preferences) {
                    super();
                    this.context              = context;
                Severity: Minor
                Found in sites/src/js/viewmodel/chart/slider.js - About 3 hrs to fix

                  LoginPageModel has 30 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  export default class LoginPageModel extends AbstractPageModel {
                  
                    constructor() {
                      super();
                      this.authenticator            = ContainerJS.Inject;
                  Severity: Minor
                  Found in sites/src/js/viewmodel/pages/login-page-model.js - About 3 hrs to fix

                    SMTPServerSettingModel has 29 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    export default class SMTPServerSettingModel extends Observable {
                    
                      constructor(smtpServerSettingService, timeSource) {
                        super();
                        this.smtpServerSettingService  = smtpServerSettingService;
                    Severity: Minor
                    Found in sites/src/js/viewmodel/settings/smtp-server-setting-model.js - About 3 hrs to fix

                      TableModel has 28 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      export default class TableModel extends Observable {
                      
                        constructor(defaultSortOrder, pageSize=100) {
                          super();
                          this.pageSize  = pageSize;
                      Severity: Minor
                      Found in sites/src/js/viewmodel/widgets/table-model.js - About 3 hrs to fix

                        Function createDetailsView has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          createDetailsView( position ) {
                            const closingPolicy = position.closingPolicy || nullPosition.closingPolicy;
                            return (
                              <div className="position-details">
                                <div className="profit-or-loss">
                        Severity: Major
                        Found in sites/src/js/view/components/positions/position-details-view.js - About 3 hrs to fix

                          Function createPasswordResetterPanel has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            createPasswordResetterPanel() {
                              return <div className="password-resetter">
                                <div className="login-link">
                                  <a onClick={() => this.setState({showPasswordResetter:false})}>
                                    ← ログイン画面に戻る
                          Severity: Major
                          Found in sites/src/js/view/components/pages/login-page.js - About 3 hrs to fix

                            BacktestBuilder has 26 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            export default class BacktestBuilder extends Observable {
                            
                              constructor() {
                                super();
                            
                            
                            Severity: Minor
                            Found in sites/src/js/viewmodel/backtests/backtest-builder.js - About 3 hrs to fix

                              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

                                Function render has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  render() {
                                    return (
                                      <div className="mailaddress-and-password-setting-view">
                                        <h3>メールアドレスとパスワードの設定</h3>
                                        <div className="description">

                                  TradingSummaryModel has 24 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  export default class TradingSummaryModel extends Observable {
                                  
                                    constructor(summary) {
                                      super();
                                      _.pairs(summary).forEach(
                                  Severity: Minor
                                  Found in sites/src/js/viewmodel/trading-summary/trading-summary-model.js - About 2 hrs to fix

                                    InitialSettingsPageModel has 23 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    export default class InitialSettingsPageModel extends Observable {
                                    
                                      constructor() {
                                        super();
                                        this.viewModelFactory      = ContainerJS.Inject;
                                    Severity: Minor
                                    Found in sites/src/js/viewmodel/pages/initial-settings-page-model.js - About 2 hrs to fix

                                      CandleSticks has 22 functions (exceeds 20 allowed). Consider refactoring.
                                      Open

                                      export default class CandleSticks extends Observable {
                                      
                                        constructor(coordinateCalculator, rates, preferences, pairSelector) {
                                          super();
                                          this.rates                = rates;
                                      Severity: Minor
                                      Found in sites/src/js/viewmodel/chart/candle-sticks.js - About 2 hrs to fix

                                        Method collect_properties has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def collect_properties(keys = instance_variables.map { |n| n[1..-1].to_sym })
                                              keys.each_with_object({}) do |name, obj|
                                                next if name == :broker
                                        
                                                v = instance_variable_get("@#{name}")
                                        Severity: Minor
                                        Found in src/jiji/model/trading/order.rb - About 2 hrs to fix

                                        Cognitive Complexity

                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                        A method's cognitive complexity is based on a few simple rules:

                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                        • Code is considered more complex for each "break in the linear flow of the code"
                                        • Code is considered more complex when "flow breaking structures are nested"

                                        Further reading

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language