binary-com/binary-next-gen

View on GitHub

Showing 162 of 551 total issues

File UpgradeToMaltainvestCard.js has 622 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { PureComponent } from 'react';
import moment from 'moment';
import {
  M, InputGroup, SelectGroup, LogoSpinner, Legend, Button,
  ErrorMsg, ServerErrorMsg, Countries, MultiSelectGroup
Severity: Major
Found in src/upgrade/UpgradeToMaltainvestCard.js - About 1 day to fix

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

        render() {
            const { formData, progress, serverError, statesList, hasError, errors } = this.state;
            const { residenceList, boot, loginid } = this.props;
    
            const language = (boot.language || 'en').toLowerCase();
    Severity: Major
    Found in src/upgrade/UpgradeToRealCard.js - About 1 day to fix

      Function initAuthorized has 182 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const initAuthorized = async (authData, store) => {
          if (/japan/.test(authData.authorize.landing_company_name)) {
              showError('Sorry, for japan user please login through www.binary.com ');
              store.dispatch(actions.updateAppState('authorized', false));
              store.dispatch(actions.updateToken(''));
      Severity: Major
      Found in src/_data/LiveData.js - About 7 hrs to fix

        File UpgradeCard.options.js has 404 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        export default {
            salutationOptions: [
              {
                value: '',
                text: 'Please select',
        Severity: Minor
        Found in src/upgrade/UpgradeCard.options.js - About 5 hrs to fix

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

            render() {
              const { formData, success, serverError, errors } = this.state;
              return (
                <div className="settings-self-exclusion">
                  <form onSubmit={this.onFormSubmit}>
          Severity: Major
          Found in src/settings/SettingsSelfExclusion.js - About 5 hrs to fix

            File redux-saga_v0.11.x.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // flow-typed signature: 49be8ddf10387180033fd58b9175b67d
            // flow-typed version: c5c02016d4/redux-saga_v0.11.x/flow_>=v0.28.x
            
            /* @flow */
            
            
            Severity: Minor
            Found in flow-typed/npm/redux-saga_v0.11.x.js - About 5 hrs to fix

              Function initAuthorized has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

              const initAuthorized = async (authData, store) => {
                  if (/japan/.test(authData.authorize.landing_company_name)) {
                      showError('Sorry, for japan user please login through www.binary.com ');
                      store.dispatch(actions.updateAppState('authorized', false));
                      store.dispatch(actions.updateToken(''));
              Severity: Minor
              Found in src/_data/LiveData.js - About 4 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 UpgradeToRealCard.js has 364 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { PureComponent } from 'react';
              import moment from 'moment';
              import {
                  M, InputGroup, SelectGroup, LogoSpinner, Legend, Button,
                  ErrorMsg, ServerErrorMsg, Countries
              Severity: Minor
              Found in src/upgrade/UpgradeToRealCard.js - About 4 hrs to fix

                Function init has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                (function init() {
                    // clean stale data in local storage
                    localStorage.removeItem('assets');
                    localStorage.removeItem('settings');
                
                
                Severity: Minor
                Found in www/boot.js - About 4 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

                Function render has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                Open

                    render() {
                        const { formData, progress, serverError, statesList, hasError, errors } = this.state;
                        const { residenceList, boot, loginid } = this.props;
                
                        const language = (boot.language || 'en').toLowerCase();
                Severity: Minor
                Found in src/upgrade/UpgradeToRealCard.js - About 4 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

                Function init has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                (function init() {
                    // clean stale data in local storage
                    localStorage.removeItem('assets');
                    localStorage.removeItem('settings');
                
                
                Severity: Major
                Found in www/boot.js - About 4 hrs to fix

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

                      render() {
                          const { states, residenceList } = this.props;
                          const { formData, serverError, success, hasError, errors } = this.state;
                      const taxResidenceList = residenceList.slice();
                      taxResidenceList.filter(props => {
                  Severity: Major
                  Found in src/settings/SettingsUserInformation.js - About 3 hrs to fix

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

                        render() {
                            const { contract, currency, disabled, errors, index,
                                pipSize, proposal, style, tradeParams, fractionalDigits, defaultStake } = this.props;
                    
                            const selectedCategory = tradeParams.get('tradeCategory');
                    Severity: Major
                    Found in src/trade-params/TradeParams.js - About 3 hrs to fix

                      Function getConstraints has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const getConstraints = (formData, limits) => {
                        const numVerify = {
                          numericality: {
                            onlyInteger: true
                          }
                      Severity: Major
                      Found in src/settings/SettingsSelfExclusion.validation.config.js - About 3 hrs to fix

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

                        export const getConstraints = (props) => {
                          const constraints = {
                            ...getUpgradeRealConstraints(),
                            forex_trading_experience: {
                              presence: true,
                        Severity: Major
                        Found in src/upgrade/UpgradeToMaltainvestCard.validation.config.js - About 3 hrs to fix

                          Function getConstraints has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const getConstraints = () => {
                            const constraints = {
                              salutation: {
                                presence: true,
                              },
                          Severity: Major
                          Found in src/upgrade/UpgradeToRealCard.validation.config.js - About 3 hrs to fix

                            File LiveData.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { LiveApi } from 'binary-live-api';
                            import { showError, timeLeftToNextRealityCheck, nowAsEpoch } from 'binary-utils';
                            import difference from 'lodash/difference';
                            import * as actions from '../_actions';
                            import {
                            Severity: Minor
                            Found in src/_data/LiveData.js - About 2 hrs to fix

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

                                  render() {
                                      const {
                                          currency,
                                          paymentAgent,
                                      } = this.props;
                              Severity: Major
                              Found in src/deposit/WithdrawalForm.js - About 2 hrs to fix

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

                                    render() {
                                        const { account_balance, withdrawal_for_x_days_monetary,
                                            open_positions, lifetime_limit, market_specific, payout } = this.props;
                                        const marketLimits = [].concat(...Object.values(market_specific));
                                
                                
                                Severity: Major
                                Found in src/settings/SettingsLimits.js - About 2 hrs to fix

                                  Function getUpgradeInfo has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      const getUpgradeInfo = (landingCompany, upgradeableLandingCompanies, currentLandingCompany, accounts, currencyConfig) => {
                                          let canUpgrade = !!(upgradeableLandingCompanies && upgradeableLandingCompanies.length);
                                          let canUpgradeMultiAccount = false;
                                          let multi = false;
                                          let typeOfNextAccount;
                                  Severity: Major
                                  Found in src/_data/LiveData.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language