gerard2p/koaton-cli

View on GitHub
src/support/EmberBuilder.js

Summary

Maintainability
B
4 hrs
Test Coverage

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

    async live (nginxbuilt, live) {
        let storebuffer = '';
        return new Promise(async resolve => {
            let appst = { log: false, result: '', success: false, pid: null, process: null };
            let port = await detect(4200);
Severity: Minor
Found in src/support/EmberBuilder.js - About 1 hr to fix

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

        async postbuild () {
            const emberinternalname = require(this.path('package.json')).name;
            let text = await readFile(ProyPath('public', this.directory, 'index.html'), { encoding: 'utf-8' }),
                indextemplate = await readFile(TemplatePath('ember_apps', 'index.handlebars'), 'utf-8'),
                meta = new RegExp(`<meta ?name="${emberinternalname}.*" ?content=".*" ?/>`);
    Severity: Minor
    Found in src/support/EmberBuilder.js - About 1 hr to fix

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

          createWatcher (reload) {
              let watcher = new Watch(ProyPath('public', this.directory, '**/*'), {
                  // ignored: ,
                  persistent: true,
                  ignoreInitial: true,
      Severity: Minor
      Found in src/support/EmberBuilder.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

      TODO found
      Open

      // TODO: please check when the proccess failed.
      Severity: Minor
      Found in src/support/EmberBuilder.js by fixme

      There are no issues that match your filters.

      Category
      Status