radare/radare2-webui

View on GitHub

Showing 243 of 2,691 total issues

Function processSelection has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    processSelection(isPrev) {
        if (isPrev) {
            this.cleanSelection(true);
        }

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

function do_rename(element, inEvent) {
    var address = get_address_from_class(element);
    if ($(element).hasClass('addr') && $(element).hasClass('flag')) {
        var space = '*';
        if ($(element).hasClass('function')) space = 'functions';
Severity: Minor
Found in www/p/lib/js/panels/disasm_panel.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 add has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    add(widget) {
        if (this.populatedWidgets.indexOf(widget) !== -1) {
            // Can't open the same panel more than once: draw() should be called
            return;
        }
Severity: Minor
Found in www/m/js/layout/ContainerZone.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 handleKeyDown has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    KeyHandler.prototype.handleKeyDown = function(e) {
      var current_node, key, moveDown, moveLeft, moveRight, moveUp, selectNode;
      if (!this.tree_widget.options.keyboardSupport) {
        return;
      }
Severity: Major
Found in www/p/lib/js/dependencies/tree.jquery.js - About 2 hrs to fix

    File statusbar.legacy.js has 275 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* TODO
     * - add timestamp
     * - support tabs and console
     */
    var statusLog = [];
    Severity: Minor
    Found in www/m/js/helpers/statusbar/statusbar.legacy.js - About 2 hrs to fix

      Function itemSelected has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          itemSelected: function(inSender, inEvent) {
              var self = this;
              var selected = inEvent.originator.content;
              var is_visible = this.$.menu.getShowing();
              r2ui.rp = self;
      Severity: Major
      Found in www/enyo/js/rightpanel.js - About 2 hrs to fix

        Function getTextLogger has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        r2.getTextLogger = function(obj) {
            if (typeof (obj) != 'object') {
                obj = {};
            }
            obj.last = 0;
        Severity: Major
        Found in www/lib/r2.js - About 2 hrs to fix

          Function addLongListDialog has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              addLongListDialog(list) {
                  var _this = this;
                  var dialog = document.createElement('dialog');
                  dialog.className = 'mdl-dialog';
          
          
          Severity: Major
          Found in www/m/js/modules/disasm/Disassembly.js - About 2 hrs to fix

            Function populateFrom has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                populateFrom(offset) {
                    // From currentOffset
                    // I want at least 80% of 3 screens
            
                    // go up of 1 screen, take first in order
            Severity: Minor
            Found in www/m/js/modules/disasm/DisassemblyNavigator.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 render has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

            BBGraph.prototype.render = function() {
                var name = Object.keys(this.vertices).toString();
                var outergbox = document.createElement('div');
                outergbox.id = 'outergbox';
                var bbcanvas = document.getElementById('canvas');
            Severity: Minor
            Found in www/lib/disasm.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 drawChunk has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                drawChunk(chunk, where) {
                    if (chunk.offset === 0 && chunk.hex.length === 0) {
                        return this.firstElement;
                    }
            
            
            Severity: Major
            Found in www/m/js/modules/hexdump/Hexdump.js - About 2 hrs to fix

              Function do_rename has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function do_rename(element, inEvent) {
                  var address = get_address_from_class(element);
                  if ($(element).hasClass('addr') && $(element).hasClass('flag')) {
                      var space = '*';
                      if ($(element).hasClass('function')) space = 'functions';
              Severity: Major
              Found in www/p/lib/js/panels/disasm_panel.js - About 2 hrs to fix

                Function getPanel has 60 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: Major
                Found in www/m/js/widgets/FunctionsWidget.js - About 2 hrs to fix

                  Function _selectNode has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      JqTreeWidget.prototype._selectNode = function(node, must_toggle) {
                        var canSelect, deselected_node, openParents, saveState;
                        if (must_toggle == null) {
                          must_toggle = false;
                        }
                  Severity: Major
                  Found in www/p/lib/js/dependencies/tree.jquery.js - About 2 hrs to fix

                    Function Ajax has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function Ajax(method, uri, body, fn, err) {
                        if (typeof (XMLHttpRequest) == 'undefined') {
                            return false;
                        }
                        if (r2.asyncMode == 'fake') {
                    Severity: Major
                    Found in www/lib/r2.js - About 2 hrs to fix

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

                      function handleClick(inEvent) {
                      
                          if ($(inEvent.target).hasClass('addr')) {
                              if ($(inEvent.target).hasClass('history')) {
                                  var idx = inEvent.target.className.split(' ').filter(function(x) { return x.substr(0, 'history_idx_'.length) == 'history_idx_'; });
                      Severity: Major
                      Found in www/p/lib/js/panels/disasm_panel.js - About 2 hrs to fix

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

                            getPanel() {
                                var c = document.createElement('div');
                                if (this.inColor) {
                                    c.style.backgroundColor = '#202020';
                                }
                        Severity: Major
                        Found in www/m/js/widgets/FlagsSpacesWidget.js - About 2 hrs to fix

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

                              instanciate_(widget) {
                                  switch (widget) {
                                  case Widgets.OVERVIEW:
                                      this.widgets[widget] = new OverviewWidget();
                                      break;
                          Severity: Major
                          Found in www/m/js/widgets/WidgetFactory.js - About 2 hrs to fix

                            Function modalMenu has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function modalMenu () {
                              var menu = [
                                'Analyze:aaa',
                                'Assembler:&Assembler',
                                'Classes:icc',
                            Severity: Major
                            Found in www/t/js/modals.js - About 2 hrs to fix

                              Function handle_hex_double_click has 55 lines of code (exceeds 25 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: Major
                              Found in www/p/lib/js/panels/hex_panel.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language