volebo/volebo-express

View on GitHub

Showing 8 of 13 total issues

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

function main(configPath, overrideOptions) {
    const app = express()

    /*
    ========================================================
Severity: Major
Found in src/server.js - About 6 hrs to fix

    Function vbexp has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

    const vbexp = function(configPath, overrideOptions) {
    
        const app = createListener(configPath, overrideOptions)
    
        app.start = function app_start(done)
    Severity: Minor
    Found in src/index.js - About 5 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 main has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    function main(configPath, overrideOptions) {
        const app = express()
    
        /*
        ========================================================
    Severity: Minor
    Found in src/server.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 vbexp has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const vbexp = function(configPath, overrideOptions) {
    
        const app = createListener(configPath, overrideOptions)
    
        app.start = function app_start(done)
    Severity: Major
    Found in src/index.js - About 3 hrs to fix

      Function app_start has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          app.start = function app_start(done)
          {
              if (!done) {
                  done = function(err) {
                      if (err) {
      Severity: Major
      Found in src/index.js - About 3 hrs to fix

        Function registerHbsHelpers has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function registerHbsHelpers(app) {
        
            const customHelpers = {
        
                // t(domain, key, ...args) {
        Severity: Minor
        Found in src/hbs-helpers/index.js - About 1 hr to fix

          Function loadConfig has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function loadConfig(configPath, overrideOptions) {
              const _defsPath = path.resolve(path.join(__dirname, 'configuration.default.yml'))
              const defs = yaml.load(fs.readFileSync(_defsPath, 'utf8'))
          
              nconf.use('overrides', {
          Severity: Minor
          Found in src/loaders/configuration.js - About 1 hr to fix

            Function registerHbsHelpers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function registerHbsHelpers(app) {
            
                const customHelpers = {
            
                    // t(domain, key, ...args) {
            Severity: Minor
            Found in src/hbs-helpers/index.js - About 25 mins 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