Showing 8 of 62 total issues
Function createSimmer
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function createSimmer (
windowScope = window,
customConfig = {},
customQuery = false
) {
- Read upRead up
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
Open
// var config = require('../../nightwatch.conf.js')
const compareElementsAndSimmer = (
browser,
selector,
exports
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
module.exports = {
before: function (browser, done) {
server = require('../server')(done) // done is a callback that executes when the server is started
},
Function createSimmer
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function createSimmer (
windowScope = window,
customConfig = {},
customQuery = false
) {
File index.test.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import fixture from './fixture'
import {
queryEngine,
NoResult,
compareParentElementAndSimmer,
Function simmer
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const simmer = function (element) {
if (!element) {
// handle error
onError.call(
simmer,
Function queryEngine
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
export const queryEngine = document => ({
query: (...args) => {
if (!document) {
throw Error(
'No global scoped document is available - somethign is wrong with the test runner'
- Read upRead up
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
Open
export default function (hierarchy, state, validateSelector, config, query) {