bakerface/wireless-tools

View on GitHub

Showing 12 of 32 total issues

Function parse_status_block has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function parse_status_block(block) {
  var match;

  var parsed = {
    interface: block.match(/^([^\s^\:]+)/)[1]
Severity: Minor
Found in ifconfig.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 parse_status_block has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function parse_status_block(block) {
  var match;

  var parsed = {
    interface: block.match(/^([^\s^\:]+)/)[1]
Severity: Minor
Found in ifconfig.js - About 1 hr to fix

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

    function parse_status_block(block) {
        var match;
    
        var parsed = {};
        if ((match = block.match(/bssid=([A-Fa-f0-9:]{17})/))) {
    Severity: Minor
    Found in wpa_cli.js - About 1 hr to fix

      Function parse_status_block has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      function parse_status_block(block) {
          var match;
      
          var parsed = {};
          if ((match = block.match(/bssid=([A-Fa-f0-9:]{17})/))) {
      Severity: Minor
      Found in wpa_cli.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 parse_cell has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function parse_cell(cell) {
        var parsed = { };
        var match;
      
        if ((match = cell.match(/Address\s*[:|=]\s*([A-Fa-f0-9:]{17})/))) {
      Severity: Minor
      Found in iwlist.js - About 1 hr to fix

        Function parse_cell has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function parse_cell(cell) {
          var parsed = { };
          var match;
        
          if ((match = cell.match(/BSS ([0-9A-Fa-f:-]{17})\(on/))) {
        Severity: Minor
        Found in iw.js - About 1 hr to fix

          Function parse_status_block has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function parse_status_block(block) {
            var match;
          
            // Skip out of the block is invalid
            if (!block) return;
          Severity: Minor
          Found in iwconfig.js - About 1 hr to fix

            Function parse_cell has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function parse_cell(cell) {
              var parsed = { };
              var match;
            
              if ((match = cell.match(/BSS ([0-9A-Fa-f:-]{17})\(on/))) {
            Severity: Minor
            Found in iw.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 parse_cell has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function parse_cell(cell) {
              var parsed = { };
              var match;
            
              if ((match = cell.match(/Address\s*[:|=]\s*([A-Fa-f0-9:]{17})/))) {
            Severity: Minor
            Found in iwlist.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 parse_status_block has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function parse_status_block(block) {
              var match;
            
              // Skip out of the block is invalid
              if (!block) return;
            Severity: Minor
            Found in iwconfig.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 parse_scan_results has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function parse_scan_results(block) {
                var match;
                var results = [];
                var lines;
            
            
            Severity: Minor
            Found in wpa_cli.js - About 1 hr to fix

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

              function set_network(interface, id, variable, value, callback) {
              Severity: Minor
              Found in wpa_cli.js - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language