binary-com/binary-next-gen

View on GitHub
src/upgrade/UpgradeToRealCard.js

Summary

Maintainability
F
1 wk
Test Coverage

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

    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 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 constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          constructor(props) {
              super(props);
              this.state = {
                  hasError: false,
                  progress: false,
      Severity: Minor
      Found in src/upgrade/UpgradeToRealCard.js - About 1 hr to fix

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

                            {/VR/i.test(loginid) &&
                                <div>
                                    <Legend text="Security" />
                                    <div className="input-row">
                                        <SelectGroup
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 1 day to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 618..645

        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 250.

        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

            onCountryChange = (e: SyntheticEvent) => {
                this.onEntryChange(e);
                const formData = this.state.formData;
                const countryInResidenceList = this.props.residenceList.find(country => country.value === this.props.country_code);
                formData.phone = countryInResidenceList ? `+${countryInResidenceList.phone_idd}` : '';
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 6 hrs to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 102..110

        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 170.

        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

            onFormSubmit = (e: SyntheticEvent) => {
                e.preventDefault();
                const newErrors = this.validationMan.validateAll(this.state.formData);
                this.setState({ errors: newErrors });
                const keys = Object.keys(newErrors);
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 6 hrs to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 130..141

        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 166.

        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

                            <div className="input-row">
                                <select id="place_of_birth" onChange={this.onEntryChange} value={formData.place_of_birth || ''}>
                                    <option value="" disabled>Place of Birth</option>
                                    {residenceList && residenceList.map((x: Residence) =>
                                        <option
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 5 hrs to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 252..264

        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 149.

        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

                            <div className="input-row">
                                <InputGroup
                                    id="last_name"
                                    value={formData.last_name || ''}
                                    placeholder="Last Name"
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 2 hrs to fix
        src/upgrade/UpgradeToRealCard.js on lines 183..194

        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 91.

        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

                            <div className="input-row">
                                <InputGroup
                                    id="first_name"
                                    value={formData.first_name || ''}
                                    placeholder="First Name"
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 2 hrs to fix
        src/upgrade/UpgradeToRealCard.js on lines 197..208

        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 91.

        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

                            <div className="input-row date-of-birth">
                                <InputGroup
                                    id="date_of_birth"
                                    disabled={this.props.date_of_birth}
                                    label="Date of Birth"
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 2 hrs to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 239..249

        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 86.

        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

                                <select id="address_state" onChange={this.onEntryChange} value={formData.address_state} defaultValue="">
                                    <option value="" disabled>Address state</option>
                                    {statesList.map(x => (
                                        <option key={x.value} value={x.value}>{x.text}</option>
                                    ))}
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 2 hrs to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 316..321

        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 78.

        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

                if (!nextProps.phone && nextProps.country_code) {
                    const countryInResidenceList = nextProps.residenceList.find(country => country.value === nextProps.country_code);
                    formData.phone = countryInResidenceList && countryInResidenceList.phone_idd ? `+${countryInResidenceList.phone_idd}` : '';
                }
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 2 hrs to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 87..90

        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 77.

        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

                    if (this.props.selectedCurrency && this.props.selectedCurrency !== '') {
                        this.context.router.replace('/');
                    } else {
                        this.context.router.replace('/set-currency');
                    }
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 1 hr to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 164..168

        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 73.

        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 23 locations. Consider refactoring.
        Open

                            <div className="input-row">
                                <SelectGroup
                                    label="Account opening reason"
                                    value={formData.account_opening_reason || ''}
                                    id="account_opening_reason"
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 22 other locations - About 1 hr to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 267..275
        src/upgrade/UpgradeToMaltainvestCard.js on lines 387..395
        src/upgrade/UpgradeToMaltainvestCard.js on lines 398..406
        src/upgrade/UpgradeToMaltainvestCard.js on lines 409..417
        src/upgrade/UpgradeToMaltainvestCard.js on lines 420..428
        src/upgrade/UpgradeToMaltainvestCard.js on lines 431..439
        src/upgrade/UpgradeToMaltainvestCard.js on lines 442..450
        src/upgrade/UpgradeToMaltainvestCard.js on lines 453..461
        src/upgrade/UpgradeToMaltainvestCard.js on lines 464..472
        src/upgrade/UpgradeToMaltainvestCard.js on lines 475..483
        src/upgrade/UpgradeToMaltainvestCard.js on lines 486..494
        src/upgrade/UpgradeToMaltainvestCard.js on lines 497..505
        src/upgrade/UpgradeToMaltainvestCard.js on lines 508..516
        src/upgrade/UpgradeToMaltainvestCard.js on lines 519..527
        src/upgrade/UpgradeToMaltainvestCard.js on lines 530..538
        src/upgrade/UpgradeToMaltainvestCard.js on lines 541..549
        src/upgrade/UpgradeToMaltainvestCard.js on lines 552..560
        src/upgrade/UpgradeToMaltainvestCard.js on lines 563..571
        src/upgrade/UpgradeToMaltainvestCard.js on lines 574..582
        src/upgrade/UpgradeToMaltainvestCard.js on lines 585..593
        src/upgrade/UpgradeToMaltainvestCard.js on lines 596..604
        src/upgrade/UpgradeToMaltainvestCard.js on lines 607..615

        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 72.

        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 10 locations. Consider refactoring.
        Open

                            <div className="input-row">
                                <InputGroup
                                    id="address_city"
                                    value={formData.address_city || ''}
                                    placeholder="Town/City"
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 9 other locations - About 1 hr to fix
        src/settings/SettingsUserInformation.js on lines 182..191
        src/upgrade/UpgradeToMaltainvestCard.js on lines 294..303
        src/upgrade/UpgradeToMaltainvestCard.js on lines 325..334
        src/upgrade/UpgradeToMaltainvestCard.js on lines 337..346
        src/upgrade/UpgradeToMaltainvestCard.js on lines 349..358
        src/upgrade/UpgradeToMaltainvestCard.js on lines 361..370
        src/upgrade/UpgradeToRealCard.js on lines 282..291
        src/upgrade/UpgradeToRealCard.js on lines 294..303
        src/upgrade/UpgradeToRealCard.js on lines 306..315

        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 71.

        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 10 locations. Consider refactoring.
        Open

                            <div className="input-row">
                                <InputGroup
                                    id="address_line_2"
                                    value={formData.address_line_2 || ''}
                                    placeholder="Address Second Line"
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 9 other locations - About 1 hr to fix
        src/settings/SettingsUserInformation.js on lines 182..191
        src/upgrade/UpgradeToMaltainvestCard.js on lines 294..303
        src/upgrade/UpgradeToMaltainvestCard.js on lines 325..334
        src/upgrade/UpgradeToMaltainvestCard.js on lines 337..346
        src/upgrade/UpgradeToMaltainvestCard.js on lines 349..358
        src/upgrade/UpgradeToMaltainvestCard.js on lines 361..370
        src/upgrade/UpgradeToRealCard.js on lines 270..279
        src/upgrade/UpgradeToRealCard.js on lines 282..291
        src/upgrade/UpgradeToRealCard.js on lines 294..303

        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 71.

        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 10 locations. Consider refactoring.
        Open

                            <div className="input-row">
                                <InputGroup
                                    id="address_postcode"
                                    value={formData.address_postcode || ''}
                                    placeholder="Postal Code / ZIP"
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 9 other locations - About 1 hr to fix
        src/settings/SettingsUserInformation.js on lines 182..191
        src/upgrade/UpgradeToMaltainvestCard.js on lines 294..303
        src/upgrade/UpgradeToMaltainvestCard.js on lines 325..334
        src/upgrade/UpgradeToMaltainvestCard.js on lines 337..346
        src/upgrade/UpgradeToMaltainvestCard.js on lines 349..358
        src/upgrade/UpgradeToMaltainvestCard.js on lines 361..370
        src/upgrade/UpgradeToRealCard.js on lines 270..279
        src/upgrade/UpgradeToRealCard.js on lines 294..303
        src/upgrade/UpgradeToRealCard.js on lines 306..315

        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 71.

        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 10 locations. Consider refactoring.
        Open

                            <div className="input-row">
                                <InputGroup
                                    id="address_line_1"
                                    value={formData.address_line_1 || ''}
                                    placeholder="Address First Line"
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 9 other locations - About 1 hr to fix
        src/settings/SettingsUserInformation.js on lines 182..191
        src/upgrade/UpgradeToMaltainvestCard.js on lines 294..303
        src/upgrade/UpgradeToMaltainvestCard.js on lines 325..334
        src/upgrade/UpgradeToMaltainvestCard.js on lines 337..346
        src/upgrade/UpgradeToMaltainvestCard.js on lines 349..358
        src/upgrade/UpgradeToMaltainvestCard.js on lines 361..370
        src/upgrade/UpgradeToRealCard.js on lines 270..279
        src/upgrade/UpgradeToRealCard.js on lines 282..291
        src/upgrade/UpgradeToRealCard.js on lines 306..315

        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 71.

        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 3 locations. Consider refactoring.
        Open

            onEntryChange = (e: SyntheticEvent) => {
                const s = this.validationMan.validateFieldAndGetNewState(e, this.state.formData);
                this.setState({ ...s, hasError: false });
            }
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 2 other locations - About 1 hr to fix
        src/settings/SettingsUserInformation.js on lines 63..66
        src/upgrade/UpgradeToMaltainvestCard.js on lines 97..100

        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 65.

        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

                                <Countries
                                    id="residence"
                                    value={formData.residence || ''}
                                    onChange={this.onCountryChange}
                                    residenceList={residenceList}
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 1 hr to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 308..314

        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 60.

        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 4 locations. Consider refactoring.
        Open

                        <div className="full-logo">
                            <LogoSpinner spinning={progress} />
                            <img className="logo-text" src="https://style.binary.com/images/logo/logotype_light.svg" alt="Logo" />
                        </div>
        Severity: Major
        Found in src/upgrade/UpgradeToRealCard.js and 3 other locations - About 1 hr to fix
        src/create-account/CreateAccountCard.js on lines 96..99
        src/create-account/VerifyEmailCard.js on lines 61..64
        src/upgrade/UpgradeToMaltainvestCard.js on lines 192..195

        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 55.

        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

            if (!/VR/i.test(loginid)) {
              const { secret_question, secret_answer, ...d } = formData; // eslint-disable-line no-unused-vars
             createAccountParams = d;
            }
        Severity: Minor
        Found in src/upgrade/UpgradeToRealCard.js and 1 other location - About 50 mins to fix
        src/upgrade/UpgradeToMaltainvestCard.js on lines 149..152

        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 51.

        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

        There are no issues that match your filters.

        Category
        Status