Apollon77/node-mbus

View on GitHub

Showing 4 of 15 total issues

Function getData has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    getData(address, options, callback) {
        // default options
        // pingFirst: Work-around buggy behaviour with some M-Bus devices,
        //            notably Sontex Supercal531
        //            https://github.com/rscada/libmbus/pull/95
Severity: Minor
Found in index.js - About 1 hr to fix

    Function close has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        close(callback, wait) {
            if (wait === undefined) {
                wait = !!callback;
            }
            if (wait && !callback) wait = false;
    Severity: Minor
    Found in index.js - About 1 hr to fix

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

          scanSecondary(callback) {
              if (!this.mbusMaster.connected && !this.options.autoConnect) {
                  if (callback) callback(new Error('Not connected and autoConnect is false'));
                  return;
              }
      Severity: Minor
      Found in index.js - About 1 hr to fix

        Avoid too many return statements within this function.
        Open

                        return true;
        Severity: Major
        Found in index.js - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language