karma-runner/karma

View on GitHub

Showing 193 of 258 total issues

Avoid too many return statements within this function.
Open

        return '<!--' + obj.nodeValue + '-->'
Severity: Major
Found in static/karma.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return obj.outerHTML
    Severity: Major
    Found in static/karma.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return obj.toString()
      Severity: Major
      Found in static/context.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return configModuleReturn.then(
              function onKarmaConfigModuleFulfilled (/* ignoredResolutionValue */) {
                return finalizeConfig(config)
              },
              function onKarmaConfigModuleRejected (reason) {
        Severity: Major
        Found in lib/config.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return Promise.resolve(finalizeConfig(config))
          Severity: Major
          Found in lib/config.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return Promise.reject(exception)
            Severity: Major
            Found in lib/config.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return finalizeConfig(config)
              Severity: Major
              Found in lib/config.js - About 30 mins to fix

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

                  onInfo (info) {
                    if (helper.isDefined(info.dump)) {
                      this.emitter.emit('browser_log', this, info.dump, 'dump')
                    }
                
                
                Severity: Minor
                Found in lib/browser.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

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

                window.__karma__.result = window.console ? function (result) {
                  if (result.skipped) {
                    this.skipped++
                    return
                  }
                Severity: Minor
                Found in static/debug.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

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

                exports.stop = function (cliOptionsOrConfig, done) {
                  cliOptionsOrConfig = cliOptionsOrConfig || {}
                  const log = logger.create('stopper')
                  done = helper.isFunction(done) ? done : process.exit
                
                
                Severity: Minor
                Found in lib/stopper.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

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

                function processAnswers (answers, basePath, testMainFile) {
                  const processedAnswers = {
                    basePath: basePath,
                    files: answers.files,
                    onlyServedFiles: [],
                Severity: Minor
                Found in lib/init.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

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

                function getBasePath (configFilePath, cwd) {
                  const configParts = path.dirname(configFilePath).split(path.sep)
                  const cwdParts = cwd.split(path.sep)
                  const base = []
                
                
                Severity: Minor
                Found in lib/init.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

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

                function run (cliOptionsOrConfig, done) {
                  cliOptionsOrConfig = cliOptionsOrConfig || {}
                  done = helper.isFunction(done) ? done : process.exit
                
                  let config
                Severity: Minor
                Found in lib/runner.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