danielwippermann/resol-vbus

View on GitHub

Showing 212 of 557 total issues

Function _generateSpecificationData has 157 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _generateSpecificationData(language) {
        const that = this;

        let units = {
            ...this.knownUnitsByCode,
Severity: Major
Found in src/specification-file.js - About 6 hrs to fix

    Function main has 148 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    async function main(options) {
        const { signal, onListen, onRunning } = (options || {});
    
        logger.debug('Starting server...');
    
    
    Severity: Major
    Found in examples/json-live-data-server/index.js - About 5 hrs to fix

      Function _onConnection has 144 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _onConnection(socket) {
              const _this = this;
      
              const connectionInfo = {
                  socket,
      Severity: Major
      Found in src/tcp-connection-endpoint.js - About 5 hrs to fix

        Function transceiveValue has 140 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async transceiveValue(valueInfo, value, options, state) {
                if (!isObject(valueInfo)) {
                    valueInfo = {
                        valueIndex: valueInfo,
                    };
        Severity: Major
        Found in src/connection-customizer.js - About 5 hrs to fix

          Function main has 140 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          async function main(args) {
              let inputRscFilename = null;
              let inputImageFilename = null;
              let outputJsFilename = null;
          
          
          Severity: Major
          Found in tools/rsc-scheme-converter/main.js - About 5 hrs to fix

            Function receive has 123 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                receive(timestamp, chunk) {
                    const _this = this;
            
                    if (this.listenerCount('rawData') > 0) {
                        this.emit('rawData', chunk, timestamp);
            Severity: Major
            Found in src/connection.js - About 4 hrs to fix

              Function onData has 121 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      const onData = function(chunk) {
                          if (phase < 1000) {
                              let buffer;
                              if (rxBuffer) {
                                  buffer = Buffer.concat([ rxBuffer, chunk ]);
              Severity: Major
              Found in src/tcp-connection-endpoint.js - About 4 hrs to fix

                Function _generateSpecificationData has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                    _generateSpecificationData(language) {
                        const that = this;
                
                        let units = {
                            ...this.knownUnitsByCode,
                Severity: Minor
                Found in src/specification-file.js - About 4 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 _processBuffer has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                Open

                    _processBuffer(chunk, endOfStream, processRecord) {
                        let buffer;
                        if (this.rxBuffer) {
                            buffer = Buffer.concat([ this.rxBuffer, chunk ]);
                        } else {
                Severity: Minor
                Found in src/vbus-recording-converter.js - About 4 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 convertRawValue has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

                    convertRawValue(rawValue_, sourceUnit_, targetUnit_) {
                        const that = this;
                
                        let conversions;
                        if (Array.isArray(sourceUnit_)) {
                Severity: Minor
                Found in src/specification.js - About 4 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 convertHeaderSet has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

                    convertHeaderSet(headerSet) {
                        const _this = this;
                
                        const spec = this.specification;
                
                
                Severity: Minor
                Found in src/text-converter.js - About 4 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 processDownloadDownloadRequest has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const processDownloadDownloadRequest = async (req, res) => {
                    try {
                        const i18n = specification.i18n;
                
                        const startDate = req.query.startDate ? i18n.momentUtc(req.query.startDate, 'MM/DD/YYYY') : i18n.momentUtc();
                Severity: Major
                Found in examples/vbustouch-proxy/index.js - About 4 hrs to fix

                  Specification has 32 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Specification {
                  
                      /**
                       * Creates a new Specification instance and optionally initializes its members with the given values.
                       *
                  Severity: Minor
                  Found in src/specification.js - About 4 hrs to fix

                    Function _emitEnd has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                        _emitEnd() {
                            const spec = this.specification;
                    
                            const allHeaders = this.allHeaderSet.getHeaders();
                    
                    
                    Severity: Minor
                    Found in src/dlx-json-converter.js - About 3 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 onLine has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                const onLine = function(line) {
                                    let newPhase = -1;
                                    if (line [0] === '+') {
                                        if (phase === 0) {
                                            if (_this.viaTag) {
                    Severity: Major
                    Found in src/tcp-connection.js - About 3 hrs to fix

                      Function completeConfiguration has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          async completeConfiguration(...configs) {
                              const _this = this;
                      
                              const adjustableValues = _this._getAdjustableValues();
                      
                      
                      Severity: Major
                      Found in src/base-configuration-optimizer.js - About 3 hrs to fix

                        Function _processRecord has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _processRecord(buffer) {
                                const type = buffer [1] & 0x0F;
                                const timestamp = moreints.readUInt64LE(buffer, 6);
                        
                                if (type === 3) {
                        Severity: Major
                        Found in src/vbus-recording-converter.js - About 3 hrs to fix

                          Function _connect has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              _connect() {
                                  return new Promise((resolve, reject) => {
                                      let cleanup = () => { reject(new Error('Called too soon')); };
                          
                                      const options = {
                          Severity: Major
                          Found in src/serial-connection.js - About 3 hrs to fix

                            Function _emitEnd has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                _emitEnd() {
                                    const spec = this.specification;
                            
                                    const allHeaders = this.allHeaderSet.getHeaders();
                            
                            
                            Severity: Major
                            Found in src/dlx-json-converter.js - About 3 hrs to fix

                              Function getPacketFieldsForHeaders has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  getPacketFieldsForHeaders(headers) {
                                      const _this = this;
                              
                                      // filter out all packets
                                      const packets = headers.reduce((memo, header) => {
                              Severity: Minor
                              Found in src/specification.js - About 3 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

                              Severity
                              Category
                              Status
                              Source
                              Language