imrefazekas/harcon

View on GitHub

Showing 45 of 85 total issues

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

module.exports = function (self) {
    return {
        _id: clerobee.generate(),
        firestarter: self,
        notifyTos: { },
Severity: Major
Found in lib/ext/Entity.js - About 4 hrs to fix

    File Inflicter.js has 359 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    let Communication = require('../lib/Communication')
    let Barrel = require('../lib/Barrel')
    let Blower = require('../lib/Blower')
    let Firestormstarter = require('../lib/Firestormstarter')
    let Flamestarter = require('../lib/Flamestarter')
    Severity: Minor
    Found in lib/Inflicter.js - About 4 hrs to fix

      Function exports has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function (self) {
          return {
              _id: clerobee.generate(),
              firestarter: self,
              notifyTos: { },
      Severity: Minor
      Found in lib/ext/Entity.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 init has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      inflicter.init = async function () {
          let self = this
      
          self.logger.harconlog( null, 'Harcon initiating...', { }, 'info' )
      
      
      Severity: Major
      Found in lib/Inflicter.js - About 3 hrs to fix

        Function purify has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        function purify ( obj, config, level ) {
            if (!obj) return obj
            if ( _.isDate(obj) || _.isBoolean(obj) || _.isNumber(obj) || _.isString(obj) || _.isRegExp(obj) )
                return obj
            if ( _.isFunction(obj) )
        Severity: Minor
        Found in lib/Inflicter.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

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

        firestarter.burn = async function ( comm ) {
            let self = this
            return new Promise( async (resolve, reject) => {
                if ( !self.concealed )
                    self.logger.harconlog(null, 'Burning', comm.shallow(), 'trace' )
        Severity: Minor
        Found in lib/Firestarter.js - About 2 hrs to fix

          Function exec has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              exec: async function ( division, event, parameters, terms ) {
                  let self = this
          
                  division = division || self.division
                  var divEvent = division + SEPARATOR + event
          Severity: Minor
          Found in lib/FireBender.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 newCommunication has 15 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          exports.newCommunication = function ( mode, originalId, flowId, externalId, sourceDivision, source, sourceNodeID, division, event, params, callback, responder, responderNodeID, error, response ) {
          Severity: Major
          Found in lib/Communication.js - About 1 hr to fix

            Function Communication has 15 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function Communication (mode, originalId, flowId, externalId, sourceDivision, source, sourceNodeID, division, event, params, callback, responder, responderNodeID, error, response) {
            Severity: Major
            Found in lib/Communication.js - About 1 hr to fix

              Function appease has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              barrel.appease = async function ( comm, err, responseComms ) {
                  if ( err || responseComms ) {
                      let answers = []
                      for (let c of responseComms ) {
                          c.arrivalDate = Date.now()
              Severity: Minor
              Found in lib/Barrel.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 deploy has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              inflicter.deploy = async function ( object, options ) {
                  if (options && _.isString(options))
                      return this.deployFunction( ...arguments )
              
                  let self = this
              Severity: Minor
              Found in lib/Inflicter.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 deploy has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              inflicter.deploy = async function ( object, options ) {
                  if (options && _.isString(options))
                      return this.deployFunction( ...arguments )
              
                  let self = this
              Severity: Minor
              Found in lib/Inflicter.js - About 1 hr to fix

                Function appease has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                firestarter.appease = async function ( error, comm, responseComms ) {
                    let self = this
                
                    let bcomm = self.blower.comm( comm.id )
                    if ( bcomm ) {
                Severity: Minor
                Found in lib/Firestarter.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 innerMatches has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                flamestarter.innerMatches = function ( eventName ) {
                    if ( this.event === '*' )
                        return true
                
                    if ( this.isRegex )
                Severity: Minor
                Found in lib/Flamestarter.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 Inflicter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                function Inflicter ( options ) {
                    let self = this
                
                    self.options = assigner.assign( {}, require('./DefaultConfig'), options || {} )
                
                
                Severity: Minor
                Found in lib/Inflicter.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 readFlows has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    readFlows: function ( folder, matcher = '.flow', defs = [] ) {
                        let files = fs.readdirSync(folder )
                        for ( let i in files ) {
                            let file = path.join(folder, files[i] )
                            if ( fs.statSync( file ).isDirectory() ) this.readFlows( file, matcher, defs )
                Severity: Minor
                Found in util/FlowReader.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 Firestormstarter has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Firestormstarter ( config, barrel, object, blower, logger ) {
                    this.config = config || {}
                
                    this.division = object.division || config.division || ''
                
                
                Severity: Minor
                Found in lib/Firestormstarter.js - About 1 hr to fix

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

                  firestarter.innerIgnite = async function ( ...parameters ) {
                      let self = this
                      let mode = parameters[ 0 ]
                      let externalId = parameters[ 1 ]
                      let flowId = parameters[ 2 ]
                  Severity: Minor
                  Found in lib/Firestarter.js - About 1 hr to fix

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

                    mortar.firstRead = async function () {
                        let self = this
                    
                        if ( self.options.waitFor && self.options.waitFor.entity && !self.inflicterContext._barrel.firestarter( self.options.waitFor.entity ) ) {
                            return setTimeout( () => {
                    Severity: Minor
                    Found in util/Mortar.js - About 1 hr to fix

                      Function igniteFiles has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      mortar.igniteFiles = async function ( ) {
                          let self = this
                      
                          let newFiles = self.files.slice()
                          self.files.length = 0
                      Severity: Minor
                      Found in util/Mortar.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language