rjrodger/use-plugin

View on GitHub

Showing 12 of 15 total issues

Function build_plugin_desc has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function build_plugin_desc(spec, useopts, eraro) {
  const plugin = spec.plugin

  // Don't do much with plugin options, just ensure they are an object.
  let options =
Severity: Minor
Found in use.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 perform_require has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

function perform_require(reqfunc, plugin_desc, builtin, level) {
  const search_list = plugin_desc.search
  let initfunc
  let search
  let found
Severity: Minor
Found in use.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 build_plugin_desc has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function build_plugin_desc(spec, useopts, eraro) {
  const plugin = spec.plugin

  // Don't do much with plugin options, just ensure they are an object.
  let options =
Severity: Major
Found in use.js - About 2 hrs to fix

    Function use_plugin_desc has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    function use_plugin_desc(plugin_desc, useopts, eraro) {
      plugin_desc.search = build_plugin_names(
        plugin_desc.name,
        useopts.builtin,
        useopts.prefix,
    Severity: Minor
    Found in use.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 use_plugin_desc has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function use_plugin_desc(plugin_desc, useopts, eraro) {
      plugin_desc.search = build_plugin_names(
        plugin_desc.name,
        useopts.builtin,
        useopts.prefix,
    Severity: Major
    Found in use.js - About 2 hrs to fix

      Function build_plugin_names has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function build_plugin_names() {
        const args = BuildNameArgu(arguments)
      
        const name = args.name
        const isRelative = name.match(/^[./]/)
      Severity: Major
      Found in use.js - About 2 hrs to fix

        Function make has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function make(useopts) {
          // Default options, overidden by caller supplied options.
          useopts = Object.assign(
            {
              prefix: 'plugin-',
        Severity: Minor
        Found in use.js - About 1 hr to fix

          Function load_plugin has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function load_plugin(plugin_desc, start_module, eraro) {
            let current_module = start_module
            let builtin = true
            let level = 0
            let funcdesc = {}
          Severity: Minor
          Found in use.js - About 1 hr to fix

            Function perform_require has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function perform_require(reqfunc, plugin_desc, builtin, level) {
              const search_list = plugin_desc.search
              let initfunc
              let search
              let found
            Severity: Minor
            Found in use.js - About 1 hr to fix

              Function make has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              function make(useopts) {
                // Default options, overidden by caller supplied options.
                useopts = Object.assign(
                  {
                    prefix: 'plugin-',
              Severity: Minor
              Found in use.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 build_plugin_names has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              function build_plugin_names() {
                const args = BuildNameArgu(arguments)
              
                const name = args.name
                const isRelative = name.match(/^[./]/)
              Severity: Minor
              Found in use.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 load_plugin has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function load_plugin(plugin_desc, start_module, eraro) {
                let current_module = start_module
                let builtin = true
                let level = 0
                let funcdesc = {}
              Severity: Minor
              Found in use.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