creative-connections/aurelia-bodylight-plugin

View on GitHub
src/elements/markdownnav.js

Summary

Maintainability
B
4 hrs
Test Coverage

Function bind has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  bind() {
    //console.log('bdlmarkdownnav src:', this.src);
    if (this.notinitread && this.src && this.src.length > 0 && this.mdtoc) this.fetchMDSrc();
    //bind navigation first - get src before content - to solve navigation hide open issue at the beginning
    //console.log('bdlmakrdownnav src:', this.src);
Severity: Minor
Found in src/elements/markdownnav.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 bind has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  bind() {
    //console.log('bdlmarkdownnav src:', this.src);
    if (this.notinitread && this.src && this.src.length > 0 && this.mdtoc) this.fetchMDSrc();
    //bind navigation first - get src before content - to solve navigation hide open issue at the beginning
    //console.log('bdlmakrdownnav src:', this.src);
Severity: Minor
Found in src/elements/markdownnav.js - About 1 hr to fix

    Function list_item_open has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        this.mdtoc.renderer.rules.list_item_open = function(tokens, idx, options, env, slf) {
    Severity: Minor
    Found in src/elements/markdownnav.js - About 35 mins to fix

      Function bullet_list_close has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          this.mdtoc.renderer.rules.bullet_list_close = function(tokens, idx, options, env, slf) { if (window.markdownnavdepth) window.markdownnavdepth--; return '</ul>';};
      Severity: Minor
      Found in src/elements/markdownnav.js - About 35 mins to fix

        Function bullet_list_open has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            this.mdtoc.renderer.rules.bullet_list_open = function(tokens, idx, options, env, slf) {
        Severity: Minor
        Found in src/elements/markdownnav.js - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status