gmmorris/simmerjs

View on GitHub

Showing 8 of 62 total issues

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

export default function createSimmer (
  windowScope = window,
  customConfig = {},
  customQuery = false
) {
Severity: Minor
Found in modules/simmer.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

File index.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// var config = require('../../nightwatch.conf.js')

const compareElementsAndSimmer = (
  browser,
  selector,
Severity: Minor
Found in __tests__/e2e/index.js - About 3 hrs to fix

    exports has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    module.exports = {
      before: function (browser, done) {
        server = require('../server')(done) // done is a callback that executes when the server is started
      },
    
    
    Severity: Minor
    Found in __tests__/e2e/index.js - About 3 hrs to fix

      Function createSimmer has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function createSimmer (
        windowScope = window,
        customConfig = {},
        customQuery = false
      ) {
      Severity: Major
      Found in modules/simmer.js - About 2 hrs to fix

        File index.test.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import fixture from './fixture'
        import {
          queryEngine,
          NoResult,
          compareParentElementAndSimmer,
        Severity: Minor
        Found in __tests__/integration/index.test.js - About 2 hrs to fix

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

            const simmer = function (element) {
              if (!element) {
                // handle error
                onError.call(
                  simmer,
          Severity: Minor
          Found in modules/simmer.js - About 2 hrs to fix

            Function queryEngine has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            export const queryEngine = document => ({
              query: (...args) => {
                if (!document) {
                  throw Error(
                    'No global scoped document is available - somethign is wrong with the test runner'
            Severity: Minor
            Found in __tests__/integration/utils.js - About 45 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 default has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            export default function (hierarchy, state, validateSelector, config, query) {
            Severity: Minor
            Found in modules/methods/inspectElementID.js - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language