unageanu/jiji2

View on GitHub

Showing 122 of 840 total issues

Function createLoginPanel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  createLoginPanel() {
    return <div className="login-panel">
      <h3>ログイン</h3>
      <div className="inputs">
        <TextField
Severity: Minor
Found in sites/src/js/view/components/pages/login-page.js - About 1 hr to fix

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

      render() {
        return (
          <div className="mail-address-setting setting">
            <h3>メールアドレスの設定</h3>
            <ul className="description">
    Severity: Minor
    Found in sites/src/js/view/components/settings/mail-address-setting-view.js - About 1 hr to fix

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

        render() {
          return (
            <MuiThemeProvider muiTheme={theme}>
              <div className="root">
                <div className="topbar">
      Severity: Minor
      Found in sites/src/js/view/components/frame.js - About 1 hr to fix

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

          render() {
            return (
              <div className="welcome-view">
                <div className="description">
                  Jijiへようこそ。<br/>
        Severity: Minor
        Found in sites/src/js/view/components/initial-settings/welcome-view.js - About 1 hr to fix

          Function createEditor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            createEditor() {
              const selectedAgent = this.state.selectedAgent;
              if (selectedAgent == null) return null;
          
              const agentClass =  this.props.model.getAgentClassForSelected();
          Severity: Minor
          Found in sites/src/js/view/components/agents/agent-property-editor.js - About 1 hr to fix

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

              render() {
                if (this.state.enablePostmark !== false) return null;
                return (
                  <div className="smtp-server-setting setting">
                    <h3>SMTPサーバーの設定</h3>
            Severity: Minor
            Found in sites/src/js/view/components/settings/smtp-server-setting-view.js - About 1 hr to fix

              Method validate_stop_loss has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  def validate_stop_loss(options, sell_or_buy)
                    price = options[:price]
                    stop_loss = options[:stopLossOnFill]
                    return if stop_loss.nil?
              
              
              Severity: Minor
              Found in src/jiji/model/securities/internal/utils/order_validator.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 registerDragAction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                registerDragAction() {
                  this.verticalPointer.addEventListener("mousedown", (event) => {
                    this.slideXStart = this.chartModel.pointer.x
                      - event.stageX/devicePixelRatio;
                    event.nativeEvent.preventDefault();
              Severity: Minor
              Found in sites/src/js/view/components/chart/pointer.js - About 1 hr to fix

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

                  render() {
                    return (
                      <span className="agent-source-editor-menu">
                        <IconButton
                          className="save-button"
                Severity: Minor
                Found in sites/src/js/view/components/agents/agent-source-editor-menu.js - About 1 hr to fix

                  Function createPageSelectorElement has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    createPageSelectorElement(selector, index) {
                      if (selector.action) {
                        const className = selector.selected ? "selected" : "";
                        const palette = Theme.palette;
                        return (
                  Severity: Minor
                  Found in sites/src/js/view/components/logs/log-viewer.js - About 1 hr to fix

                    Function createContent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      createContent() {
                        if (this.state.isLoading) {
                          return <div className="center-information">
                            <LoadingImage left={-20}/>
                          </div>;
                    Severity: Minor
                    Found in sites/src/js/view/components/pages/rmt-agent-setting-page.js - About 1 hr to fix

                      Function createActionContent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        createActionContent() {
                          const prev = () => this.props.model.prev();
                          const next = () => this.props.model.next();
                          return <div className="actions">
                            <div className="left">
                      Severity: Minor
                      Found in sites/src/js/view/components/positions/positions-table.js - About 1 hr to fix

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

                          createDetailsView(notification) {
                            return <div className="notification-details">
                              <div className="top-panel">
                                <div className="avatar-panel">
                                  {this.createAvatar(notification)}

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

                            render() {
                              this.updateEditorSize();
                              const errorElement = this.createErrorElement();
                              return (
                                <div className="agent-source-editor">
                          Severity: Minor
                          Found in sites/src/js/view/components/agents/agent-source-editor.js - About 1 hr to fix

                            Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              constructor() {
                            
                                this.xhrManager        = ContainerJS.Inject;
                                this.errorHandler      = ContainerJS.Inject;
                                this.eventQueue        = ContainerJS.Inject;
                            Severity: Minor
                            Found in sites/src/js/viewmodel/application.js - About 1 hr to fix

                              Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def initialize(backtest, start_time, end_time,
                                    interval_id, pairs, balance, orders, modules)
                              Severity: Major
                              Found in src/jiji/model/trading/brokers/back_test_broker.rb - About 1 hr to fix

                                Method build_components has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def build_components(backtest, start_time, end_time,
                                      interval_id, pairs, orders, positions, modules)
                                Severity: Major
                                Found in src/jiji/model/trading/brokers/back_test_broker.rb - About 1 hr to fix

                                  Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def initialize(pair, timestamp, open, close = open,
                                        high = open, low = open, volume = 0, close_timestamp = timestamp) #:nodoc:
                                  Severity: Major
                                  Found in src/jiji/model/trading/rate.rb - About 1 hr to fix

                                    Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def initialize(pair, units, distance, broker,
                                          index_graph = nil, bands_graph = nil, logger = nil,
                                          calculator = BollingerBandsCalculator.new)
                                    Severity: Major
                                    Found in sample_agents/src/bollinger_bands_agent.rb - About 1 hr to fix

                                      Method create_securities_configuration has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def create_securities_configuration(backtest,
                                            start_time, end_time, interval_id, pairs, orders, positions, modules)
                                      Severity: Major
                                      Found in src/jiji/model/trading/brokers/back_test_broker.rb - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language