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
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();
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(''));
File UpgradeCard.options.js
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
export default {
salutationOptions: [
{
value: '',
text: 'Please select',
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}>
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 */
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(''));
- Read upRead up
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
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');
- Read upRead up
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();
- Read upRead up
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');
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 => {
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');
Function getConstraints
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getConstraints = (formData, limits) => {
const numVerify = {
numericality: {
onlyInteger: true
}
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,
Function getConstraints
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getConstraints = () => {
const constraints = {
salutation: {
presence: true,
},
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 {
Function render
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
currency,
paymentAgent,
} = this.props;
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));
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;