radare/radare2-webui

View on GitHub

Showing 243 of 2,691 total issues

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

LogsPanel.prototype.render = function() {
    function encode(r) {
        return r.replace(/[\x26\x0A\<>'"]/g, function(r) {return '&#' + r.charCodeAt(0) + ';';});
    }
    var self = this;
Severity: Minor
Found in www/p/lib/js/panels/logs_panel.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

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

    drawWords_(hexpairs, asciis, pairs, chars, modifications, offset, size) {
        var words = this.pairs2words(pairs, size);
        hexpairs.classList.add('words');

        for (var x = 0 ; x < pairs.length ; x++) {
Severity: Minor
Found in www/m/js/modules/hexdump/Hexdump.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

Avoid deeply nested control flow statements.
Open

                    if (line.dashed) ctx.setLineDash([2,3]);
Severity: Major
Found in www/lib/disasm.js - About 45 mins to fix

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

    function appendTo(list, elems) {
        if (elems === null) {
            return;
        }
        for (var i = 0 ; i < elems.length ; i++) {
    Severity: Minor
    Found in www/m/workers/disasmNavProvider.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

    Avoid deeply nested control flow statements.
    Open

                for (var i = 0; i < a.length; i++) { this.frames[col].push(a[i]); }
    Severity: Major
    Found in www/t/js/tiled.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                      if (!space) {
                          continue;
                      }
      Severity: Major
      Found in www/lib/r2.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    for (var i = 0; i < a.length; i++) { this.frames.push(a[i]); }
        Severity: Major
        Found in www/t/js/tiled.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if (color !== undefined && color !== null) {
                                  if (sel == '.ec_gui_background' || sel == '.ec_gui_alt_background') {
                                      myrules[j].style.backgroundColor = color;
                                  } else if (sel == '.ec_border') myrules[j].style.borderColor = color;
                                  else myrules[j].style.color = color;
          Severity: Major
          Found in www/lib/r2ui.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        for (var i = 0; i < lines.length; i++) {
                            var elems = lines[i].split(/ /g);
                            var name = '';
                            var addr = '';
                            for (var j = 0; j < elems.length; j++) {
            Severity: Major
            Found in www/lib/r2.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          for (var col in this.frames) {
                            for (var row in this.frames[col]) {
                              prev = this.frames[col][row];
                              break;
                            }
              Severity: Major
              Found in www/t/js/tiled.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if (line.dashed) ctx.setLineDash([2,3]);
                Severity: Major
                Found in www/lib/disasm.js - About 45 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if ((r2.varMap[ins.fcn_addr] !== null && r2.varMap[ins.fcn_addr] !== undefined && r2.varMap[ins.fcn_addr].length > 0) ||
                              (r2.argMap[ins.fcn_addr] !== null && r2.argMap[ins.fcn_addr] !== undefined && r2.argMap[ins.fcn_addr].length > 0)) {
                          for (var i in r2.varMap[ins.fcn_addr]) {
                              var var_name = r2.varMap[ins.fcn_addr][i].name;
                              var var_id = r2.varMap[ins.fcn_addr][i].id;
                  Severity: Major
                  Found in www/lib/disasm.js - About 40 mins to fix

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

                    function uiSelect(dom, name, list, defaultOffset, onChange) {
                    Severity: Minor
                    Found in www/m/js/helpers/ui.legacy.js - About 35 mins to fix

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

                        this.new_frame = function (name, body, update, pos, cb) {
                      Severity: Minor
                      Found in www/t/js/tiled.js - About 35 mins to fix

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

                        function Ajax(method, uri, body, fn, err) {
                        Severity: Minor
                        Found in www/lib/r2.js - About 35 mins to fix

                          Function addRow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              addRow(cells) {
                                  var tr = document.createElement('tr');
                                  this.tbody.appendChild(tr);
                          
                                  for (var i = 0; i < cells.length; i++) {
                          Severity: Minor
                          Found in www/m/js/helpers/Table.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

                          Function getFlags has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getFlags(minSize, callback) {
                                  var filter = function(flags) {
                                      var filteredFlags = [];
                                      for (var i = 0 ; i < flags.length ; i++) {
                                          if (flags[i].size >= minSize) {
                          Severity: Minor
                          Found in www/m/js/modules/hexdump/HexPairNavigator.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

                          Function init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              init() {
                                  this.root = document.createElement('table');
                                  this.root.className = 'mdl-data-table mdl-data-table--selectable mdl-shadow--2dp';
                                  if (this.root.id !== false) {
                                      this.root.id = this.id;
                          Severity: Minor
                          Found in www/m/js/helpers/Table.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

                          Function getWidget has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getWidget(name, autobinding) {
                                  var autobinding = (typeof autobinding === 'undefined'); // Default is true
                          
                                  for (var i = 0 ; i < this.widgets.length ; i++) {
                                      if (this.widgets[i].getName() === name) {
                          Severity: Minor
                          Found in www/m/js/layout/ContainerZone.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

                          Function statusMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function statusMessage(x, t) {
                              var statusbar = document.getElementById('statusbar');
                              if (x) {
                                  statusLog.push(x);
                              }
                          Severity: Minor
                          Found in www/m/js/helpers/statusbar/statusbar.legacy.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