Showing 67 of 368 total issues
Function transformTimePicker
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const transformTimePicker = (el) => {
const timePickerEl = el.closest(TIME_PICKER);
const initialInputEl = timePickerEl.querySelector(`input`);
- 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 buildFileObj
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function buildFileObj(dir, file, dataFile){
const templateFile = file
const dataFilePath = `${dir}/${dataFile}`
const name = !dataFile
? `${file.substr(file.lastIndexOf('/') + 1).replace('.twig', '.html')}`
- 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 getCountMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getCountMessage = (currentLength, maxLength) => {
let newMessage = "";
if (currentLength === 0) {
newMessage = `${maxLength} ${DEFAULT_STATUS_LABEL}`;
- 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 generateDynamicRegExp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const generateDynamicRegExp = (filter, query = "", extras = {}) => {
const escapeRegExp = (text) =>
text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
let find = filter.replace(/{{(.*?)}}/g, (m, $1) => {
- 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 pathGenerator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const pathGenerator = asGenerator((item, ...rest) => [
...defaultJoinGenerator(item, ...rest),
item.isAbsolute
? null
: /\.(png|svg|jpg|jpeg|gif)$/.test(item.uri)
- 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 completeSelection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const completeSelection = (el) => {
const { comboBoxEl, selectEl, inputEl, statusEl } = getComboBoxContext(el);
statusEl.textContent = "";
- 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 isDateInputInvalid
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const isDateInputInvalid = (el) => {
const { externalInputEl, minDate, maxDate } = getDatePickerContext(el);
const dateString = externalInputEl.value;
let isInvalid = 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"