radare/radare2-webui

View on GitHub

Showing 243 of 2,691 total issues

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

function setStatusbarBody() {
    function addElement(e, id) {
        var doc = document.createElement(e);
        doc.id = id;
        doc.className = id;
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

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

    drawContextualMenu() {
        var exportOp = (name, range, command, ext) => {
            var output;
            r2.cmd(command + ' ' + (range.to - range.from) + ' @' + range.from, (d) => { output = d; });

Severity: Minor
Found in www/m/js/modules/hexdump/Hexdump.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 drawChunk has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    drawChunk(chunk, where) {
        if (chunk.offset === 0 && chunk.hex.length === 0) {
            return this.firstElement;
        }

Severity: Minor
Found in www/m/js/modules/hexdump/Hexdump.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 hex_menu_to_console has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function hex_menu_to_console() {
    value = '';
    if (r2ui._hex.dragEnd > -1 && r2ui._hex.dragStart > -1) {
        if (r2ui._hex.dragEnd + 1 < r2ui._hex.dragStart) { // reverse select
            var cells = $('span.dword').slice(r2ui._hex.dragEnd, r2ui._hex.dragStart + 1).addClass('autohighlighti');
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 handleInputTextChange has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DisasmPanel.prototype.handleInputTextChange = function() {
    if (this.renaming !== null && this.rbox.value.length > 0) {
        if ($(this.selected).hasClass('insaddr')) {
            var old_value = get_offset_flag(r2ui._dis.selected_offset);
            var type = 'offsets';
Severity: Minor
Found in www/p/lib/js/panels/disasm_panel.js - About 1 hr to fix

    Function getPanel has 31 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/CommentsWidget.js - About 1 hr to fix

      Function drawEmptyDialog has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          drawEmptyDialog() {
              var _this = this;
              this.dialog = document.createElement('dialog');
              this.dialog.className = 'mdl-dialog';
      
      
      Severity: Minor
      Found in www/m/js/layout/FlexContainer.js - About 1 hr to fix

        Function createTree has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        TypesPanel.prototype.createTree = function() {
            var $tree = $('#types');
            $tree.tree({
                data: this.data,
                slide: false,
        Severity: Minor
        Found in www/p/lib/js/panels/types_panel.js - About 1 hr to fix

          Function render_functions has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function render_functions(functions) {
              var imports = null;
              r2.cmdj('iij', function(x) {
                  imports = x;
              });
          Severity: Minor
          Found in www/p/lib/js/main.js - About 1 hr to fix

            Function handleInputTextChange has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                handleInputTextChange: function() {
                    if (this.renaming !== null && this.rbox.value.length > 0) {
                        if ($(this.selected).hasClass('insaddr')) {
                            var old_value = get_offset_flag(r2ui._dis.selected_offset);
                            var type = 'offsets';
            Severity: Minor
            Found in www/enyo/js/disassembler.js - About 1 hr to fix

              Function goToAddress has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  goToAddress: function() {
                      if (this.renaming === null && this.selected !== null && (this.selected.className.indexOf(' addr ')) - 1) {
                          var address = get_address_from_class(this.selected);
                          if (this.selected.className.indexOf('ec_dataoffset') > -1) {
                              // address is located in not executable memory, switching to hex view
              Severity: Minor
              Found in www/enyo/js/disassembler.js - About 1 hr to fix

                Function _init has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    JqTreeWidget.prototype._init = function() {
                      JqTreeWidget.__super__._init.call(this);
                      this.element = this.$el;
                      this.mouse_delay = 300;
                      this.is_initialized = false;
                Severity: Minor
                Found in www/p/lib/js/dependencies/tree.jquery.js - About 1 hr to fix

                  Function openPage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      openPage: function(idx) {
                          var str, sp = this.$.panels;
                          // TODO: this is just a hack
                          var r = -1;
                          switch (idx) {
                  Severity: Minor
                  Found in www/enyo/js/mainpanel.js - About 1 hr to fix

                    Function applyFlags has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        applyFlags(lines, blockInitialOffset, flags) {
                            if (!this.showFlags) {
                                return;
                            }
                    
                    
                    Severity: Minor
                    Found in www/m/js/modules/hexdump/Hexdump.js - About 1 hr to fix

                      Function moveItem has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          DragAndDropHandler.prototype.moveItem = function(position_info) {
                            var doMove, event, moved_node, position, previous_parent, target_node;
                            if (this.hovered_area && this.hovered_area.position !== Position.NONE && this.canMoveToArea(this.hovered_area)) {
                              moved_node = this.current_item.node;
                              target_node = this.hovered_area.node;
                      Severity: Minor
                      Found in www/p/lib/js/dependencies/tree.jquery.js - About 1 hr to fix

                        Function infiniteDrawingContent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            infiniteDrawingContent(where, pos, endCallback) {
                                this.nav.get(where, (chunk) => {
                                    if (where === NavigatorDirection.BEFORE) {
                                        this.isTopMax = chunk.offset === 0;
                                    } else {
                        Severity: Minor
                        Found in www/m/js/modules/hexdump/Hexdump.js - About 1 hr to fix

                          Function new_modal has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            this.new_modal = function (name, body, items, cb) {
                              var title = html.div('modal_title', 'modal_title', {
                                backgroundColor: '#c0c0c0',
                                display: 'inline',
                                overflowX: 'hidden'
                          Severity: Minor
                          Found in www/t/js/tiled.js - About 1 hr to fix

                            Function getSlot has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                getSlot(widget) {
                                    let widgetIndex = this.displayedWidgets.indexOf(widget);
                                    if (~widgetIndex) { // We want a slot for an already displayed widget
                                        return this.contentNode.children[widgetIndex];
                                    }
                            Severity: Minor
                            Found in www/m/js/core/UIContext.js - About 1 hr to fix

                              Function get has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  get(offset, size, callback) {
                                      // TODO: retrieve data (async) and call
                                      var item;
                                      for (var i = 0 ; i < this.items.length ; i++) {
                                          if (this.items[i].offset === offset &&
                              Severity: Minor
                              Found in www/m/js/modules/disasm/DisassemblyNavigator.js - About 1 hr to fix

                                Function onmessage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        this.providerWorker.onmessage = function(e) {
                                            if (e.data.dir === NavigatorDirection.CURRENT) {
                                                if (typeof _this.curChunk.data.callback !== 'undefined') {
                                                    for (var i = 0 ; i < _this.curChunk.data.callback.length ; i++) {
                                                        _this.curChunk.data.callback[i](e.data);
                                Severity: Minor
                                Found in www/m/js/core/BlockNavigator.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language