binary-com/binary-next-gen

View on GitHub

Showing 551 of 551 total issues

File pl.js has 1235 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export default {
    "": {
        "plural-forms": "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);",
        "x-generator": "crowdin.com",
        "x-crowdin-project": "nexy-gen",
Severity: Major
Found in src/_constants/po/pl.js - About 3 days to fix

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

      render() {
        const { progress, serverError, formData, statesList, hasError, errors } = this.state;
        const { residenceList, loginid, boot } = this.props;
        const language = (boot.language || 'en').toLowerCase();
        const linkToTermsAndConditions = `https://www.binary.com/${language}/terms-and-conditions.html`;
    Severity: Major
    Found in src/upgrade/UpgradeToMaltainvestCard.js - About 2 days to fix

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

        render() {
          const { progress, serverError, formData, statesList, hasError, errors } = this.state;
          const { residenceList, loginid, boot } = this.props;
          const language = (boot.language || 'en').toLowerCase();
          const linkToTermsAndConditions = `https://www.binary.com/${language}/terms-and-conditions.html`;
      Severity: Minor
      Found in src/upgrade/UpgradeToMaltainvestCard.js - About 1 day 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

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

          staysinout: {
              RANGE: {
                  barriers: {
                      daily: [
                          {
      Severity: Major
      Found in src/_constants/MockContract.js and 1 other location - About 1 day to fix
      src/_constants/MockContract.js on lines 384..469

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

      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

          endsinout: {
              EXPIRYMISS: {
                  barriers: {
                      daily: [
                          {
      Severity: Major
      Found in src/_constants/MockContract.js and 1 other location - About 1 day to fix
      src/_constants/MockContract.js on lines 494..579

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

      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

      File MockContract.js has 647 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { nextXDay } from 'binary-utils';
      
      export const mockedContract = {
          asian: {
              ASIANU: {
      Severity: Major
      Found in src/_constants/MockContract.js - About 1 day to fix

        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
        Severity: Major
        Found in src/upgrade/UpgradeToMaltainvestCard.js - About 1 day to fix

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

                  CALL: {
                      durations: [
                          {
                              min: 5,
                              max: 10,
          Severity: Major
          Found in src/_constants/MockContract.js and 1 other location - About 1 day to fix
          src/_constants/MockContract.js on lines 100..172

          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

          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

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

                  PUT: {
                      durations: [
                          {
                              min: 5,
                              max: 10,
          Severity: Major
          Found in src/_constants/MockContract.js and 1 other location - About 1 day to fix
          src/_constants/MockContract.js on lines 27..99

          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

          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/UpgradeToMaltainvestCard.js and 1 other location - About 1 day to fix
          src/upgrade/UpgradeToRealCard.js on lines 331..357

          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

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

                          <table>
                              <thead><tr /></thead>
                              <tbody>
                                  <tr>
                                      <Td text="Withdrawal limit" />
          Severity: Major
          Found in src/settings/SettingsLimits.js and 1 other location - About 1 day to fix
          src/settings/SettingsLimits.js on lines 23..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 242.

          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

                          <table>
                              <thead><tr /></thead>
                              <tbody>
                                  <tr>
                                      <Td text="Maximum number of open positions" />
          Severity: Major
          Found in src/settings/SettingsLimits.js and 1 other location - About 1 day to fix
          src/settings/SettingsLimits.js on lines 63..85

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

          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

          describe('settingsSelectors', () => {
              const emptyState = () => ({
                  settings: fromJS({}),
                  account: fromJS({}),
                  boot: fromJS({}),
          Severity: Major
          Found in src/settings/__tests__/settingsSelectors-test.js and 1 other location - About 1 day to fix
          src/deposit/__tests__/depositSelectors-test.js on lines 4..28

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

          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

          describe('depositSelectors', () => {
              const emptyState = () => ({
                  paymentAgent: fromJS({}),
                  account: fromJS({}),
                  settings: fromJS({}),
          Severity: Major
          Found in src/deposit/__tests__/depositSelectors-test.js and 1 other location - About 1 day to fix
          src/settings/__tests__/settingsSelectors-test.js on lines 4..28

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

          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

          describe('indicativeTotal', () => {
               it('should equal 0 for emtpy proposal list', () => {
                   const actual = indicativeTotalSelector({
                       boughtContracts: fromJS({}),
                   });
          Severity: Major
          Found in src/portfolio/__tests__/indicativeTotalSelector-test.js and 1 other location - About 1 day to fix
          src/portfolio/__tests__/purchaseTotalSelector-test.js on lines 4..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 227.

          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

          describe('purchaseTotal', () => {
              it('should equal 0 when no contracts', () => {
                  const actual = purchaseTotalSelector({
                      boughtContracts: fromJS({}),
                  });
          Severity: Major
          Found in src/portfolio/__tests__/purchaseTotalSelector-test.js and 1 other location - About 1 day to fix
          src/portfolio/__tests__/indicativeTotalSelector-test.js on lines 4..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 227.

          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

              touchnotouch: {
                  ONETOUCH: {
                      barriers: {
                          daily: [
                              {
          Severity: Major
          Found in src/_constants/MockContract.js and 1 other location - About 1 day to fix
          src/_constants/MockContract.js on lines 174..243

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

          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

              higherlower: {
                  CALL: {
                      barriers: {
                          daily: [
                              {
          Severity: Major
          Found in src/_constants/MockContract.js and 1 other location - About 1 day to fix
          src/_constants/MockContract.js on lines 580..649

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

          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 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
            Severity
            Category
            Status
            Source
            Language