Showing 162 of 551 total issues
Function getConstraints
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getConstraints = (props) => {
const constraints = {
address_line_1: {
presence: true,
validateAddress: true,
Function render
has a Cognitive Complexity of 17 (exceeds 5 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 => {
- 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 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { dateStart, forwardStartingDuration, index, startLaterOnly } = this.props;
const { showStartLater, forwardDate, forwardTime } = this.state;
const ranges = forwardStartingDuration.range;
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { verificationCode, password, confirmPassword, residence, validatedOnce, progress, serverError } = this.state;
const residenceIsValid = !!residence;
const verificationCodeIsValid = verificationCode.length >= 8 && verificationCode.length <= 128;
const passwordIsValid = isValidPassword(password);
Function changeActiveLayout
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const changeActiveLayout = (tradesCount, layoutN) =>
(dispatch, getState) => {
const { assets, tradesParams } = getState();
const currentTradeCount = tradesParams.size;
const additionTradeNeeded = tradesCount - currentTradeCount;
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
barrier,
barrier2,
barrierInfo,
Function render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { upgradeInfo, nextAccountTitle, markets, currencyOptions, loginid } = this.props;
const { currency_error, disable_create_account } = this.state;
return (
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
amountPerPoint,
currency,
index,
Function changeActiveLayout
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
(dispatch, getState) => {
const { assets, tradesParams } = getState();
const currentTradeCount = tradesParams.size;
const additionTradeNeeded = tradesCount - currentTradeCount;
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
confirmIntervalUpdate,
loginTime,
sessionDuration,
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { validatedOnce, serverError, success, currentPassword, newPassword, confirmPassword } = this.state;
const currentPasswordIsValid = isValidPassword(currentPassword);
const newPasswordIsValid = isValidPassword(newPassword);
const passwordsMatch = newPassword === confirmPassword;
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
dateStart,
duration,
durationUnit,
Function upgradeConfirm
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
async (dispatch, getState) => {
const { upgrade } = getState();
const {
salutation,
firstName,
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { backBtnBarTitle, children, toolbarShown, inverse, backTo } = this.props;
if (Device.isAndroid()) {
// In android devices, there is a strange issue where the keyboard obstructs the input
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { compact, currency, transactions, transactionsTotal, digits } = this.props;
return (
<table>
Function signIn
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const signIn = () => {
const oAuthUrl = `${window.BinaryBoot.oAuthUrl}?app_id=${window.BinaryBoot.appId}&l=${window.BinaryBoot.language}`;
if (electron) {
const { BrowserWindow } = electron.remote;
authWindow = new BrowserWindow({
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { loginid, existingAccounts } = this.props;
return (
<div className="create-new-account-card">
Function render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
barrier,
barrier2,
barrierInfo,
- 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { compact, contracts, onViewDetails, payoutTotal, purchaseTotal, indicativeTotal, digits, currency } = this.props;
return (
<table>
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { contract, tradeParams, onClose } = this.props;
const selectedCategory = tradeParams.tradeCategory;
const selectedType = tradeParams.type;
const { tradeGroup } = this.state;