binary-com/binary-next-gen

View on GitHub

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,
Severity: Major
Found in src/settings/SettingsUserInformation.validation.config.js - About 2 hrs to fix

    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 => {
    Severity: Minor
    Found in src/settings/SettingsUserInformation.js - About 2 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 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;
    
    
    Severity: Major
    Found in src/duration-picker/ForwardStartingOptions.js - About 2 hrs to fix

      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);
      Severity: Minor
      Found in src/create-account/CreateAccountCard.js - About 2 hrs to fix

        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;
        Severity: Minor
        Found in src/_actions/WorkspaceActions.js - About 1 hr 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 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            render() {
                const {
                    barrier,
                    barrier2,
                    barrierInfo,
        Severity: Minor
        Found in src/barrier-picker/BarrierCard.js - About 1 hr to fix

          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 (
          Severity: Minor
          Found in src/user-accounts/CreateNewAccount.js - About 1 hr to fix

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

                render() {
                    const {
                        amountPerPoint,
                        currency,
                        index,
            Severity: Minor
            Found in src/barrier-picker/SpreadBarrierCard.js - About 1 hr to fix

              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;
              
              
              Severity: Minor
              Found in src/_actions/WorkspaceActions.js - About 1 hr to fix

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

                    render() {
                        const {
                            confirmIntervalUpdate,
                            loginTime,
                            sessionDuration,
                Severity: Minor
                Found in src/reality-check/RealityCheckSummaryCard.js - About 1 hr to fix

                  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;
                  Severity: Minor
                  Found in src/settings/SettingsChangePassword.js - About 1 hr to fix

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

                        render() {
                            const {
                                dateStart,
                                duration,
                                durationUnit,
                    Severity: Minor
                    Found in src/duration-picker/DurationCard.js - About 1 hr to fix

                      Function upgradeConfirm has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          async (dispatch, getState) => {
                              const { upgrade } = getState();
                              const {
                                  salutation,
                                  firstName,
                      Severity: Minor
                      Found in src/_actions/UpgradeActions.js - About 1 hr to fix

                        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
                        Severity: Minor
                        Found in src/containers/MobilePage.js - About 1 hr to fix

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

                              render() {
                                  const { compact, currency, transactions, transactionsTotal, digits } = this.props;
                          
                                  return (
                                      <table>
                          Severity: Minor
                          Found in src/statement/StatementTable.js - About 1 hr to fix

                            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({
                            Severity: Minor
                            Found in src/_data/Auth.js - About 1 hr to fix

                              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">
                              Severity: Minor
                              Found in src/user-accounts/ExistingAccounts.js - About 1 hr to fix

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

                                    render() {
                                        const {
                                            barrier,
                                            barrier2,
                                            barrierInfo,
                                Severity: Minor
                                Found in src/barrier-picker/BarrierCard.js - About 1 hr 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 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    render() {
                                        const { compact, contracts, onViewDetails, payoutTotal, purchaseTotal, indicativeTotal, digits, currency } = this.props;
                                
                                        return (
                                            <table>
                                Severity: Minor
                                Found in src/portfolio/PortfolioList.js - About 1 hr to fix

                                  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;
                                  Severity: Minor
                                  Found in src/trade-type-picker/TradeTypePicker.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language