binary-com/binary-next-gen

View on GitHub

Showing 551 of 551 total issues

Avoid too many return statements within this function.
Open

            return state.merge(action.settings);
Severity: Major
Found in src/_reducers/SettingsReducer.js - About 30 mins to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        & (<T1, T2, T3, T4, T5, Y, R, N, Fn: Saga5<Y, R, N, T1, T2, T3, T4, T5>>(saga: Fn, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, ...rest: Array<void>) => Task)
    Severity: Minor
    Found in flow-typed/npm/redux-saga_v0.11.x.js and 1 other location - About 30 mins to fix
    flow-typed/npm/redux-saga_v0.11.x.js on lines 105..105

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 45.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    type ConnectMergedStateless = <P, SP, DP, MP, Dispatch: Function>(
      mapStateToProps: (state: Object, ownProps: $Diff<P, MP>) => SP,
      mapDispatchToProps: (dispatch: Dispatch, ownProps: $Diff<P, MP>) => DP,
      mergeProps: (stateProps: SP, dispatchProps: DP, ownProps: $Diff<P, MP>) => MP,
      options?: {pure?: boolean, withRef?: boolean}
    Severity: Minor
    Found in flow-typed/npm/react-redux_v4.x.x.js and 1 other location - About 30 mins to fix
    flow-typed/npm/react-redux_v4.x.x.js on lines 40..45

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 45.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    type ConnectNoStateStatless = <P, DP, Dispatch: Function>(
        mapStateToProps: null | void,
        mapDispatchToProps: (dispatch: Dispatch, ownProps: $Diff<P, DP>) => DP,
        mergeProps: null | void,
        options?: {pure?: boolean, withRef?: boolean}
    Severity: Minor
    Found in flow-typed/npm/react-redux_v4.x.x.js and 1 other location - About 30 mins to fix
    flow-typed/npm/react-redux_v4.x.x.js on lines 26..31

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 45.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

         & (<T1, T2, T3, T4, T5, Y, R, N, Fn: Saga5<Y, R, N, T1, T2, T3, T4, T5>>(pattern: Pattern, saga: Fn, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, ...rest: Array<void>) => TakeXRet)
    Severity: Minor
    Found in flow-typed/npm/redux-saga_v0.11.x.js and 1 other location - About 30 mins to fix
    flow-typed/npm/redux-saga_v0.11.x.js on lines 138..138

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 45.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function getCurrencyOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    const getCurrencyOptions = (loginid, landingCompany, accounts, currencyConfig) => {
        const legalAllowedCurrencies = landingCompanyValue(loginid, 'legal_allowed_currencies', landingCompany);
        if (/CR/i.test(loginid)) {
          const existingCurrencies = getExistingCurrencies(accounts);
          if (existingCurrencies.length) {
    Severity: Minor
    Found in src/_utils/Client.js - About 25 mins 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 mergeTicks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    export const mergeTicks = (existingTicks, newTicks) => {
        if (!existingTicks || existingTicks.length === 0) {
            return newTicks;
        }
    
    
    Severity: Minor
    Found in src/_reducers/TickReducer.js - About 25 mins 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 marketTreeSelector has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        assets =>
            assets.reduce((tree, sym) => {
                let result = tree;
                const market = sym.get('market');
                const submarket = sym.get('submarket');
    Severity: Minor
    Found in src/_selectors/marketTreeSelectors.js - About 25 mins 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 getTicksByCount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    export const getTicksByCount = (symbol, count, subscribe = true) =>
        (dispatch, getState) => {
            const { ticks } = getState();
            if (subscribe && !ticks.get(symbol)) {
                return api
    Severity: Minor
    Found in src/_actions/TickActions.js - About 25 mins 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 landingCompanyValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    export const landingCompanyValue = (loginid, key, landingCompany) => {
      let landingCompanyOfAccount;
      const landingCompanyObject = landingCompany;
      if (isAccountOfType('financial', loginid)) {
        landingCompanyOfAccount = landingCompanyObject.financial_company;
    Severity: Minor
    Found in src/_utils/Client.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
    Open

        render() {
            const {
                currency,
                paymentAgent,
            } = this.props;
    Severity: Minor
    Found in src/deposit/WithdrawalForm.js - About 25 mins 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