ethereum/mist

View on GitHub

Showing 443 of 443 total issues

Function add has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      add(id, options, callback) {
        const args = Array.prototype.slice.call(arguments);
        callback = _.isFunction(args[args.length - 1]) ? args.pop() : null;
        options = _.isObject(args[args.length - 1]) ? args.pop() : null;
        id =
Severity: Minor
Found in modules/preloader/include/mistAPI.js - About 1 hr to fix

    Function parseFee has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      parseFee() {
        const {
          estimatedGas,
          gasPriceGweiStandard,
          gasPriceGweiPriority,
    Severity: Minor
    Found in interface/components/SendTx/FeeSelector.js - About 1 hr to fix

      Function renderLocalStats has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        renderLocalStats() {
          const { syncMode } = this.props.local;
          const { currentBlock } = this.props.local.sync;
      
          let syncText;
      Severity: Minor
      Found in interface/components/NodeInfo/index.js - About 1 hr to fix

        Function exports has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(windowId) {
          if (typeof window === 'undefined') {
            return;
          }
        
        
        Severity: Minor
        Found in modules/preloader/include/consoleLogCapture.js - About 1 hr to fix

          Function init has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.init = () => {
            const filePath = Settings.dbFilePath;
          
            return Q.try(() => {
              // if db file doesn't exist then create it
          Severity: Minor
          Found in modules/db.js - About 1 hr to fix

            Function send has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              async send(method, params = [], retry = false) {
                if (!Array.isArray(params)) {
                  params = [params];
                }
            
            
            Severity: Minor
            Found in modules/ethereumNodeRemote.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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              render() {
                const tx = this.props.tx;
                const networkString = this.props.networkString(tx.networkId);
                let network = '';
                if (networkString !== 'Main') {
            Severity: Minor
            Found in interface/components/TxHistory/TxRow.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

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

                  this._socket.on('close', hadError => {
                    // if we did the disconnection then all good
                    if (STATE.DISCONNECTING === this._state) {
                      return;
                    }
            Severity: Major
            Found in modules/sockets/web3Http.js and 1 other location - About 1 hr to fix
            modules/sockets/web3Ipc.js on lines 29..36

            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

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

                  for (i = 1, args = new Array(len - 1); i < len; i++) {
                    args[i - 1] = arguments[i];
                  }
            Severity: Major
            Found in modules/preloader/injected/EventEmitter3.js and 1 other location - About 1 hr to fix
            modules/preloader/injected/EventEmitter3.js on lines 172..174

            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

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

                          for (j = 1, args = new Array(len - 1); j < len; j++) {
                            args[j - 1] = arguments[j];
                          }
            Severity: Major
            Found in modules/preloader/injected/EventEmitter3.js and 1 other location - About 1 hr to fix
            modules/preloader/injected/EventEmitter3.js on lines 144..146

            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

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

                  <div>
                    <div className="looking-for-peers row-icon">
                      <i className="icon icon-share" />
                      {i18n.t('mist.nodeInfo.lookingForPeers')}
                    </div>
            Severity: Major
            Found in interface/components/NodeInfo/index.js and 1 other location - About 1 hr to fix
            interface/components/NodeInfo/index.js on lines 55..60

            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

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

                      <div>
                        <div className="remote-loading row-icon">
                          <i className="icon icon-energy" />
                          {i18n.t('mist.nodeInfo.connecting')}
                        </div>
            Severity: Major
            Found in interface/components/NodeInfo/index.js and 1 other location - About 1 hr to fix
            interface/components/NodeInfo/index.js on lines 83..88

            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

                  this._socket.on('close', hadError => {
                    // if we did the disconnection then all good
                    if (STATE.DISCONNECTING === this._state) {
                      return;
                    }
            Severity: Major
            Found in modules/sockets/web3Ipc.js and 1 other location - About 1 hr to fix
            modules/sockets/web3Http.js on lines 101..108

            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

            Function getTokenDetails has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function getTokenDetails() {
              return (dispatch, getState) => {
                dispatch({ type: '[CLIENT]:GET_TOKEN_DETAILS:START' });
            
                const contractAddress = getState().newTx.to;
            Severity: Minor
            Found in interface/actions.js - About 1 hr to fix

              Function create has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                create(type, opts, callback) {
                  store.dispatch({
                    type: '[MAIN]:WINDOW:CREATE_START',
                    payload: { type }
                  });
              Severity: Minor
              Found in modules/windows.js - About 1 hr to fix

                Function lookupSignature has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function lookupSignature(data) {
                  return dispatch => {
                    dispatch({ type: '[CLIENT]:LOOKUP_SIGNATURE:START' });
                
                    if (!data || data.length <= 8) {
                Severity: Minor
                Found in interface/actions.js - About 1 hr to fix

                  Function _sendToRemote has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _sendToRemote(payload, retry = false) {
                      return new Promise(async (resolve, reject) => {
                        const requestId = await ethereumNodeRemote.send(
                          payload.method,
                          payload.params
                  Severity: Minor
                  Found in modules/ipc/methods/base.js - About 1 hr to fix

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

                      getById(id) {
                        log.trace('Get by id', id);
                    
                        return _.find(this._windows, w => {
                          return w.id === id;
                    Severity: Major
                    Found in modules/windows.js and 1 other location - About 1 hr to fix
                    modules/windows.js on lines 612..618

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

                    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

                      getByType(type) {
                        log.trace('Get by type', type);
                    
                        return _.find(this._windows, w => {
                          return w.type === type;
                    Severity: Major
                    Found in modules/windows.js and 1 other location - About 1 hr to fix
                    modules/windows.js on lines 620..626

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

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

                    exports.setup = function(options) {
                      const logFolder = options.logFolder;
                      const level = options.logLevel || 'info';
                    
                      const config = {
                    Severity: Minor
                    Found in modules/utils/logger.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language