radare/radare2-webui

View on GitHub

Showing 243 of 2,691 total issues

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

TypesPanel.prototype.insertData = function(k, v, array) {
    if (typeof array === 'undefined') { array = this.data; };
    var kt = k[0].trim();

    if (k.length == 1) {
Severity: Minor
Found in www/p/lib/js/panels/types_panel.js - About 1 hr to fix

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

        createExportDialog(label, output, save) {
            var dialog = document.createElement('dialog');
            dialog.className = 'mdl-dialog';
    
            if (!dialog.showModal) {
    Severity: Minor
    Found in www/m/js/modules/hexdump/Hexdump.js - About 1 hr to fix

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

          drawChunk(chunk, domAnchor) {
              domAnchor.innerHTML = chunk.data;
              // TODO Dirty workaround, see with worker usage
              const seekableElements = domAnchor.getElementsByClassName('r2seek');
              for (const el of seekableElements) {
      Severity: Minor
      Found in www/m/js/modules/disasm/Disassembly.js - About 1 hr to fix

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

        function update_minimap() {
            if (r2ui._dis.minimap && $('#canvas svg').length) {
                var minimap_width = 200;
                var minimap_height = 200;
                var svg_width = $('#canvas svg')[0].getBBox().width;
        Severity: Minor
        Found in www/lib/disasm.js - About 1 hr to fix

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

          function handle_hex_double_click(inEvent) {
              // handle offset seek
              if ($(inEvent.target).hasClass('hexaddr')) {
                  var address = get_address_from_class(inEvent.target, 'hexaddr');
                  console.log(address);
          Severity: Minor
          Found in www/p/lib/js/panels/hex_panel.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 selectRange has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          function selectRange() {
              $('span.dword').removeClass('autohighlighti');
              if (r2ui._hex.dragEnd + 1 < r2ui._hex.dragStart) { // reverse select
                  var cells = $('span.dword').slice(r2ui._hex.dragEnd, r2ui._hex.dragStart + 1).addClass('autohighlighti');
                  for (var i in cells) {
          Severity: Minor
          Found in www/p/lib/js/panels/hex_panel.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 keyHandler has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              keyHandler(e) {
                  if (e.keyCode === ACKeys.UP || e.keyCode === ACKeys.DOWN) {
                      return this.keyMovement_(e.keyCode);
                  }
          
          
          Severity: Minor
          Found in www/m/js/helpers/Autocompletion.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 dragElement has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function dragElement(elmnt) {
            var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
            if (document.getElementById(elmnt.id + "header")) {
              // if present, the header is where you move the DIV from:
              document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
          Severity: Minor
          Found in www/w/index.js - About 1 hr to fix

            Function statusNext has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function statusNext() {
                var statusbar = document.getElementById('statusbar');
                var container = document.getElementById('container');
                switch (statusMode) {
                case Mode.LINE:
            Severity: Minor
            Found in www/m/js/helpers/statusbar/statusbar.legacy.js - About 1 hr to fix

              Function drawControls has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  drawControls(dom) {
                      dom.innerHTML = '';
              
                      const more = Inputs.iconButton('list', 'Others representations');
                      more.id = 'disasm_more';
              Severity: Minor
              Found in www/m/js/modules/disasm/Disassembly.js - About 1 hr to fix

                Function BBGraph has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var BBGraph = function() {
                    this.vertices = {};
                    this.edges = [];
                    this.elements = [];
                    this.links = [];
                Severity: Minor
                Found in www/lib/disasm.js - About 1 hr to fix

                  Function onkeyup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _('body').onkeyup = function (e) {
                      if (t.modal) {
                        return;
                      }
                      var key = String.fromCharCode(e.keyCode);
                  Severity: Minor
                  Found in www/t/js/main.js - About 1 hr to fix

                    Function getState has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        SaveStateHandler.prototype.getState = function() {
                          var getOpenNodeIds, getSelectedNodeIds;
                          getOpenNodeIds = (function(_this) {
                            return function() {
                              var open_nodes;
                    Severity: Minor
                    Found in www/p/lib/js/dependencies/tree.jquery.js - About 1 hr to fix

                      Function startHandler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function startHandler(event)
                          {
                              var $elem = jQuery(this);
                      
                              // Merge the defaults and any user defined settings.
                      Severity: Minor
                      Found in www/p/lib/js/dependencies/taphold.js - About 1 hr to fix

                        Function newHelpFrame has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function newHelpFrame () {
                            var n = t.defname('help');
                            function newthing (name) {
                              // TODO: disas_code id
                              setTimeout(function () {
                        Severity: Minor
                        Found in www/t/js/main.js - About 1 hr to fix

                          Function statusConsole has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function statusConsole() {
                              var statusbar = document.getElementById('statusbar');
                              var container = document.getElementById('container');
                              if (statusTab === Tab.CONSOLE) {
                                  if (statusMode !== Mode.LINE) {
                          Severity: Minor
                          Found in www/m/js/helpers/statusbar/statusbar.legacy.js - About 1 hr to fix

                            Function _getDataUrlInfo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                JqTreeWidget.prototype._getDataUrlInfo = function(node) {
                                  var data_url, getUrlFromString;
                                  data_url = this.options.dataUrl || this.element.data('url');
                                  getUrlFromString = (function(_this) {
                                    return function() {
                            Severity: Minor
                            Found in www/p/lib/js/dependencies/tree.jquery.js - About 1 hr to fix

                              Function getPanel has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  getPanel() {
                                      var c = document.createElement('div');
                              
                                      var header = document.createElement('div');
                                      header.style.position = 'fixed';
                              Severity: Minor
                              Found in www/m/js/widgets/ClassesWidget.js - About 1 hr to fix

                                Function configureWorker_ has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    configureWorker_() {
                                        var _this = this;
                                        this.providerWorker.onmessage = function(e) {
                                            if (e.data.dir === NavigatorDirection.CURRENT) {
                                                if (typeof _this.curChunk.data.callback !== 'undefined') {
                                Severity: Minor
                                Found in www/m/js/core/BlockNavigator.js - About 1 hr to fix

                                  Function statusConsole has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function statusConsole() {
                                      var statusbar = document.getElementById('statusbar');
                                      var container = document.getElementById('container');
                                      if (statusTab === Tab.CONSOLE) {
                                          if (statusMode !== Mode.LINE) {
                                  Severity: Minor
                                  Found in www/m/js/helpers/statusbar/statusbar.legacy.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language