Showing 7 of 25 total issues
Function enhancer
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const enhancer = (state = initState || {}, action) => {
// We add a bit of safe guardin to avoid side effects
state = {
...state,
};
Function afterNavigate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const afterNavigate = (pages) => {
// We start by getting the index of the current page
const currentPageIndex = getCurrentPage(pages);
// And the page itself
const currentPage = pages[currentPageIndex];
Function onBack
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const onBack = (pages, meta) => {
// if the request is to close the model
if (meta.closeModal) {
// we get the current page index
const currentPage = getCurrentPage(pages);
- 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 exports
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (config) => {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.')
process.exit(1)
}
Function needsPatching
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const needsPatching = (userAgent) => { // eslint-disable-line
const result = /iPhone OS ([0-9_]+)/.exec(userAgent);
if (result) {
const version = result[1];
const parts = (version || '').split('_');
- 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 value
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
value: function value(predicate) {
// 1. Let O be ? ToObject(this value).
if (this == null) {
throw new TypeError('"this" is null or not defined');
}
- 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 afterNavigate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const afterNavigate = (pages) => {
// We start by getting the index of the current page
const currentPageIndex = getCurrentPage(pages);
// And the page itself
const currentPage = pages[currentPageIndex];
- 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"