creative-connections/Bodylight.js-Components

View on GitHub
src_aurelia-bodylight-plugin/src/elements/markdownaurelia.js

Summary

Maintainability
A
2 hrs
Test Coverage

Function attached has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  attached() {
    //console.log('bdlmarkdownaurelia attached() src:', this.src);
    // eslint-disable-next-line new-cap
    //optionally, register customevent handler for 'contentupdate' when fromid is defined
    // eslint-disable-next-line new-cap
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/markdownaurelia.js - About 1 hr to fix

    Function attached has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      attached() {
        //console.log('bdlmarkdownaurelia attached() src:', this.src);
        // eslint-disable-next-line new-cap
        //optionally, register customevent handler for 'contentupdate' when fromid is defined
        // eslint-disable-next-line new-cap
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/markdownaurelia.js - About 55 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

    Function registerCustomElementFunction has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const registerCustomElementFunction = () => {
      //register e.g. click on abbr element will show title and allows expand to url - wikipedia content
      //click on abbr will show extended modal info and link 
      
      //click on abbreviation shows a sibling dialog, if presented
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/markdownaurelia.js - About 45 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

    There are no issues that match your filters.

    Category
    Status