Showing 8 of 10 total issues
Function formatEvent
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export function formatEvent(attributes = {}) {
const {
title,
uid,
sequence,
- 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 formatEvent
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function formatEvent(attributes = {}) {
const {
title,
uid,
sequence,
Function createEvents
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function createEvents (events, headerAttributesOrCb, cb) {
const resolvedHeaderAttributes = typeof headerAttributesOrCb === 'object' ? headerAttributesOrCb : {};
const resolvedCb = arguments.length === 3 ? cb : (typeof headerAttributesOrCb === 'function' ? headerAttributesOrCb : null);
const run = () => {
- 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 formatDate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function formatDate(args = [], outputType = 'utc', inputType = 'local') {
if (typeof args === 'string') {
return args;
}
Function createEvents
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createEvents (events, headerAttributesOrCb, cb) {
const resolvedHeaderAttributes = typeof headerAttributesOrCb === 'object' ? headerAttributesOrCb : {};
const resolvedCb = arguments.length === 3 ? cb : (typeof headerAttributesOrCb === 'function' ? headerAttributesOrCb : null);
const run = () => {
Function setContact
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function setContact({ name, email, rsvp, dir, partstat, role, cutype, xNumGuests }) {
let formattedParts = [];
if(rsvp !== undefined){
formattedParts.push(rsvp ? 'RSVP=TRUE' : 'RSVP=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
Function formatDate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function formatDate(args = [], outputType = 'utc', inputType = 'local') {
if (typeof args === 'string') {
return args;
}
- 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 setAlarm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function setAlarm(attributes = {}) {
const {
action,
repeat,
description,
- 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"