ethereum/mist

View on GitHub

Showing 443 of 443 total issues

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

gulp.task('transpile-main', () => {
  return gulp
    .src('./main.js')
    .pipe(babel({ presets: ['es2016-node5'] }))
    .pipe(gulp.dest(`./dist_${type}/app`));
Severity: Major
Found in gulpTasks/building.js and 1 other location - About 2 hrs to fix
gulpTasks/building.js on lines 51..56

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

            {tokenDisplayName && (
              <div className="execution-context__details-row">
                <span className="execution-context__details-title">
                  {i18n.t('mist.sendTx.tokenName')}
                </span>
Severity: Major
Found in interface/components/SendTx/ExecutionContext.js and 1 other location - About 2 hrs to fix
interface/components/SendTx/ExecutionContext.js on lines 93..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 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 2 locations. Consider refactoring.
Open

        {gasError && (
          <div className="execution-context__details-row">
            <span className="execution-context__details-title">
              {i18n.t('mist.sendTx.errorMessage')}
            </span>
Severity: Major
Found in interface/components/SendTx/ExecutionContext.js and 1 other location - About 2 hrs to fix
interface/components/SendTx/ExecutionContext.js on lines 147..154

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

gulp.task('transpile-modules', () => {
  return gulp
    .src('./modules/**')
    .pipe(babel({ presets: ['es2016-node5'] }))
    .pipe(gulp.dest(`./dist_${type}/app/modules`));
Severity: Major
Found in gulpTasks/building.js and 1 other location - About 2 hrs to fix
gulpTasks/building.js on lines 44..49

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

Function settings has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const settings = (state = initialState, action) => {
  switch (action.type) {
    case '[MAIN]:DB:INIT':
      return Object.assign({}, state, { dbInit: true });
    case '[MAIN]:DB:SYNC_TO_BACKEND':
Severity: Major
Found in modules/core/settings/reducer.js - About 2 hrs to fix

    Function start has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async start() {
        if (this.starting) {
          ethereumNodeRemoteLog.trace('Already starting...');
          return this.starting;
        }
    Severity: Major
    Found in modules/ethereumNodeRemote.js - About 2 hrs to fix

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

                <div>
                  {i18n.t('mist.txHistory.newContract')}:
                  <DappIdenticon identity={tx.contractAddress} size="small" />
                  <span className="bold">{tx.contractAddress}</span>
                </div>
      Severity: Major
      Found in interface/components/TxHistory/TxRow.js and 1 other location - About 2 hrs to fix
      interface/components/TxHistory/TxRow.js on lines 218..222

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

              <div>
                {i18n.t('mist.txHistory.from')}:
                <DappIdenticon identity={tx.from} size="small" />
                <span className="bold">{tx.from}</span>
              </div>
      Severity: Major
      Found in interface/components/TxHistory/TxRow.js and 1 other location - About 2 hrs to fix
      interface/components/TxHistory/TxRow.js on lines 212..216

      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

      Function checkedUrl has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

        checkedUrl: function() {
          var template = Template.instance();
          var tab = Tabs.findOne(this._id, { fields: { redirect: 1 } });
          var url;
      
      
      Severity: Minor
      Found in interface/client/templates/views/webview.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

      File building.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const _ = require('underscore');
      const builder = require('electron-builder');
      const del = require('del');
      const { exec, execSync } = require('child_process');
      const fs = require('fs');
      Severity: Minor
      Found in gulpTasks/building.js - About 2 hrs to fix

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

              this._socket.on('error', err => {
                // connection errors will be handled in connect() code
                if (STATE.CONNECTING === this._state) {
                  return;
                }
        Severity: Major
        Found in modules/sockets/web3Ipc.js and 1 other location - About 2 hrs to fix
        modules/sockets/web3Http.js on lines 116..125

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

              this._socket.on('error', err => {
                // connection errors will be handled in connect() code
                if (STATE.CONNECTING === this._state) {
                  return;
                }
        Severity: Major
        Found in modules/sockets/web3Http.js and 1 other location - About 2 hrs to fix
        modules/sockets/web3Ipc.js on lines 56..65

        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

        Function _handleSocketResponse has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _handleSocketResponse() {
            oboe(this)
              .done(result => {
                this._log.trace('JSON response', result);
        
        
        Severity: Minor
        Found in modules/sockets/web3Base.js - About 2 hrs to fix

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

              if (
                store.getState().nodes.remote.blockNumber > 100 ||
                store.getState().nodes.local.blockNumber > 0
              ) {
                TemplateVar.set(template, 'loading', false);
          Severity: Major
          Found in interface/client/templates/layout/webviews.js and 1 other location - About 2 hrs to fix
          interface/client/templates/layout/webviews.js on lines 44..49

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

          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 (
              store.getState().nodes.remote.blockNumber > 100 ||
              store.getState().nodes.local.blockNumber > 0
            ) {
              TemplateVar.set(template, 'loading', false);
          Severity: Major
          Found in interface/client/templates/layout/webviews.js and 1 other location - About 2 hrs to fix
          interface/client/templates/layout/webviews.js on lines 52..57

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

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

            render() {
              return (
                <div className="popup-windows tx-info">
                  <div ref={divElement => (this.divElement = divElement)}>
                    <ExecutionContext
          Severity: Minor
          Found in interface/components/SendTx/index.js - About 1 hr to fix

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

                      <div className="execution-context__details-row">
                        <span className="execution-context__details-title">
                          {i18n.t('mist.sendTx.transactionExecutingFunction')}
                        </span>
                        <span className="execution-context__execution-function">
            Severity: Major
            Found in interface/components/SendTx/ExecutionContext.js and 1 other location - About 1 hr to fix
            interface/components/SendTx/ExecutionContext.js on lines 136..143

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

            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="execution-context__details-row">
                      <span className="execution-context__details-title">
                        {i18n.t('mist.sendTx.gasEstimate')}
                      </span>
                      <span className="execution-context__details-value">
            Severity: Major
            Found in interface/components/SendTx/ExecutionContext.js and 1 other location - About 1 hr to fix
            interface/components/SendTx/ExecutionContext.js on lines 103..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 69.

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

              function EthereumProvider() {
                var _this = this;
                // Call constructor of superclass to initialize superclass-derived members.
                EventEmitter.call(this);
            
            
            Severity: Minor
            Found in modules/preloader/injected/EthereumProvider.js - About 1 hr to fix

              Function _start has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _start(nodeType, network, syncMode) {
                  ethereumNodeLog.info(`Start node: ${nodeType} ${network} ${syncMode}`);
              
                  if (network === 'test' || network === 'ropsten') {
                    ethereumNodeLog.debug('Node will connect to the test network');
              Severity: Minor
              Found in modules/ethereumNode.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language