adamgibbons/ics

View on GitHub

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,
Severity: Minor
Found in src/pipeline/format.js - About 4 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

Function formatEvent has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function formatEvent(attributes = {}) {
  const {
    title,
    uid,
    sequence,
Severity: Major
Found in src/pipeline/format.js - About 2 hrs to fix

    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 = () => {
    Severity: Minor
    Found in src/index.js - About 2 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

    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;
      }
      
    Severity: Minor
    Found in src/utils/format-date.js - About 1 hr to fix

      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 = () => {
      Severity: Minor
      Found in src/index.js - About 1 hr to fix

        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;
          }
          
        Severity: Minor
        Found in src/utils/format-date.js - About 1 hr 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 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');
        Severity: Minor
        Found in src/utils/set-contact.js - About 1 hr 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 setAlarm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function setAlarm(attributes = {}) {
          const {
            action,
            repeat,
            description,
        Severity: Minor
        Found in src/utils/set-alarm.js - About 35 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

        Severity
        Category
        Status
        Source
        Language