unageanu/jiji2

View on GitHub

Showing 122 of 840 total issues

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

  render() {
    return (
      <div className="setting-finished-view">
        <h3>完了</h3>
        <div className="description">

    Pointer has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class Pointer extends Observable {
    
      constructor(coordinateCalculator, candleSticks, graphs) {
        super();
        this.coordinateCalculator = coordinateCalculator;
    Severity: Minor
    Found in sites/src/js/viewmodel/chart/pointer.js - About 2 hrs to fix

      Class AbstractBroker has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class AbstractBroker
      
          include Jiji::Model::Trading
      
          attr_reader :positions #:nodoc:
      Severity: Minor
      Found in src/jiji/model/trading/brokers/abstract_broker.rb - About 2 hrs to fix

        ValidationFunctions has 21 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export default class ValidationFunctions {
        
          static notNull( value, restriction ) {
            if ( value === null || value === undefined || value === "" ) {
              return {type : "NOT_NULL"};
        Severity: Minor
        Found in sites/src/js/utils/validation/validation-functions.js - About 2 hrs to fix

          AgentSourceEditor has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          export default class AgentSourceEditor extends Observable {
          
            constructor() {
              super();
              this.agentSources = ContainerJS.Inject;
          Severity: Minor
          Found in sites/src/js/viewmodel/agents/agent-source-editor.js - About 2 hrs to fix

            Class ClosingPolicy has 21 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class ClosingPolicy
            
                include Mongoid::Document
                include Jiji::Errors
                include Jiji::Utils::ValueObject
            Severity: Minor
            Found in src/jiji/model/trading/closing_policy.rb - About 2 hrs to fix

              Method from_h has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def from_h(hash)
                    hash.each do |k, v|
                      k = k.to_sym
                      unless v.nil?
                        if k == :price || k == :price_bound || k == :initial_price
              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

              File trading_summary.rb has 253 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'encase'
              module Jiji::Model::Trading::TradingSummaries
                class CompositeSummary
              
                  def initialize(name = nil)
              Severity: Minor
              Found in src/jiji/model/trading/trading_summaries/trading_summary.rb - About 2 hrs to fix

                File signals.rb has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module Signals
                  # 一定期間のレートデータを元に値を算出するシグナルの基底クラス
                  class RangeSignal
                
                    include Signals
                Severity: Minor
                Found in src/jiji/model/agents/builtin_files/signals.rb - About 2 hrs to fix

                  Function viewModel has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function viewModel(binder) {
                    binder.bind("application").to("viewmodel.Application");
                    binder.bind("navigator").to("viewmodel.Navigator");
                  
                    binder.bind("homePageModel")
                  Severity: Minor
                  Found in sites/src/js/composing/modules.js - About 1 hr to fix

                    Method update_from_order_options has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def update_from_order_options(options, price) #:nodoc:
                          if options.include?(:stopLoss)
                            self.stop_loss = !options[:stopLoss].nil? ? \
                              ClosingPolicy.extract_stop_loss_from_order(options[:stopLoss], price) : 0
                          end
                    Severity: Minor
                    Found in src/jiji/model/trading/closing_policy.rb - About 1 hr 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

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

                      render() {
                        return (
                          <div className="smtp-server-setting-view">
                            <h3>SMTPサーバーの設定</h3>
                            <div className="description">

                      Function createPasswordChanger has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        createPasswordChanger() {
                          return <div>
                            <div className="passwords">
                              <TextField
                                 ref="newPassword1"
                      Severity: Minor
                      Found in sites/src/js/view/components/settings/password-setting-view.js - About 1 hr to fix

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

                          render() {
                            const securitiesSelector = this.creattSecuritiesSelector();
                            const activeSecuritiesConfigurator = this.createConfigurator();
                            return (
                              <div className="securities-setting-view">

                          Function createInputFields has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            createInputFields() {
                              return <div className="inputs">
                                <div className="host-and-port">
                                  <div className="host">
                                    <TextField
                          Severity: Minor
                          Found in sites/src/js/view/components/settings/smtp-server-setting-view.js - About 1 hr to fix

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

                              render() {
                                const labelForAll = <span>
                                  すべての建玉をダウンロードする<br/>
                                  <span className="info">
                                    ※建玉が多いと時間がかかる場合があります。ご注意ください。
                            Severity: Minor
                            Found in sites/src/js/view/components/positions/download-positions-dialog.js - About 1 hr to fix

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

                                render() {
                                  const actions = [
                                    <FlatButton
                                      label="キャンセル"
                                      primary={false}
                              Severity: Minor
                              Found in sites/src/js/view/components/icons/icon-selector.js - About 1 hr to fix

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

                                  render() {
                                    const securitiesSelector = this.creattSecuritiesSelector();
                                    const activeSecuritiesConfigurator = this.createConfigurator();
                                    return (
                                      <div className="securities-setting setting">
                                Severity: Minor
                                Found in sites/src/js/view/components/settings/securities-setting-view.js - About 1 hr to fix

                                  Function onPropertyChanged has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    onPropertyChanged(name, event) {
                                      this.initPointer();
                                      if (this.chartModel.pointer.time
                                        && (this.chartModel.pointer.price || this.chartModel.pointer.balance)) {
                                        this.show();
                                  Severity: Minor
                                  Found in sites/src/js/view/components/chart/pointer.js - About 1 hr 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

                                  Function calculateHighAndLow has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    calculateHighAndLow(allValues) {
                                      const initialValue =
                                        allValues.length > 0 && allValues[0].values.length > 0
                                        ? allValues[0].values[0] : 0;
                                      const result = allValues.reduce((r, values) => {
                                  Severity: Minor
                                  Found in sites/src/js/viewmodel/chart/graph-coordinate-calculator.js - About 1 hr 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