radare/radare2-webui

View on GitHub

Showing 243 of 2,691 total issues

Function _openNode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    JqTreeWidget.prototype._openNode = function(node, slide, on_finished) {
      var doOpenNode, parent;
      if (slide == null) {
        slide = true;
      }
Severity: Minor
Found in www/p/lib/js/dependencies/tree.jquery.js - About 1 hr to fix

    Function uiSelect has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function uiSelect(dom, name, list, defaultOffset, onChange) {
        var id = 'select-' + (++selectId);
    
        var div = document.createElement('div');
        div.className = 'mdl-selectfield mdl-js-selectfield mdl-selectfield--floating-label';
    Severity: Minor
    Found in www/m/js/helpers/ui.legacy.js - About 1 hr to fix

      Function render_hexdump has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function render_hexdump(lines) {
          r2ui._hex.scrolling = true;
          var hexoffset = '<div class=\'hexoffset\'><div><div>';
          var hexdump = '<div class=\'hexdump\' style=\'color: white;\'>';
          var hextext = '<div class=\'hextext\'>';
      Severity: Minor
      Found in www/p/lib/js/panels/hex_panel.js - About 1 hr to fix

        Function keyHandler has 26 lines of code (exceeds 25 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

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

              getPanel() {
                  const c = document.createElement('div');
                  var header = document.createElement('div');
                  header.style.margin = '0.5em';
                  c.appendChild(header);
          Severity: Minor
          Found in www/m/js/widgets/SearchWidget.js - About 1 hr to fix

            Function drawTitle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                drawTitle() {
                    if (this.currentLayout === Layouts.FULL || this.populatedWidgets.length === 1) {
                        this.title.innerHTML = this.populatedWidgets[0].getName();
                    } else {
                        var titles = [];
            Severity: Minor
            Found in www/m/js/layout/ContainerZone.js - About 55 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 applyFlags has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                applyFlags(lines, blockInitialOffset, flags) {
                    if (!this.showFlags) {
                        return;
                    }
            
            
            Severity: Minor
            Found in www/m/js/modules/hexdump/Hexdump.js - About 55 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 go has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                go(where) {
                    var goNext = (where === NavigatorDirection.AFTER);
                    var dir = (goNext) ? 'next' : 'prev';
                    var howMany = this.gap;
            
            
            Severity: Minor
            Found in www/m/js/core/BlockNavigator.js - About 55 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 onkeypress has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            document.body.onkeypress = function(e) {
                if (e.ctrlKey) {
                    const keys = [
                        // panelConsole,
                        // panelDisasm,
            Severity: Minor
            Found in www/m/js/app.js - About 55 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 (found) {
                                            r2ui.seek_in_graph(address, true);
                                        } else {
                                            r2ui.seek(address, true);
                                        }
            Severity: Major
            Found in www/enyo/js/disassembler.js - About 45 mins to fix

              Function dragElement has a Cognitive Complexity of 8 (exceeds 5 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 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 ($('#gbox .instructionbox').index($(r2ui._dis.selected).closest('.instructionbox')[0]) < 10) {
                                          get_more_instructions = true;
                                          address = get_address_from_class(prev_instruction);
                                      }
              Severity: Major
              Found in www/enyo/js/disassembler.js - About 45 mins to fix

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

                    draw() {
                        const nbVals = this.entropy.length;
                        if (nbVals < 1) {
                            return;
                        }
                Severity: Minor
                Found in www/m/js/modules/overview/EntropyCard.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 ($('#gbox .instructionbox').index($(r2ui._dis.selected).closest('.instructionbox')[0]) > $('#gbox .instructionbox').length - 10) {
                                            get_more_instructions = true;
                                            address = get_address_from_class(next_instruction);
                                        }
                Severity: Major
                Found in www/enyo/js/disassembler.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              for (var i in ops) {
                                                  if (ops[i].offset === parseInt(address, 16)) {
                                                      found = true;
                                                  }
                                              }
                  Severity: Major
                  Found in www/enyo/js/disassembler.js - About 45 mins to fix

                    Function createTree has a Cognitive Complexity of 8 (exceeds 5 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 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 (prev_instruction === undefined || prev_instruction === null) {
                                                prev_instruction = $(r2ui._dis.selected).closest('.basicblock').prev().find('.insaddr').last()[0];
                                            }
                    Severity: Major
                    Found in www/enyo/js/disassembler.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (klass.indexOf('id_') === 0) eid = klass.substring(3);
                      Severity: Major
                      Found in www/enyo/js/disassembler.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if (next_instruction === undefined || next_instruction === null) {
                                                    next_instruction = $(r2ui._dis.selected).closest('.basicblock').next().find('.insaddr')[0];
                                                }
                        Severity: Major
                        Found in www/enyo/js/disassembler.js - About 45 mins to fix

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

                              run: function() {
                                  var code = this.$.input.value;
                                  var out = '';
                                  /* helper functions */
                                  function show(x) {
                          Severity: Minor
                          Found in www/enyo/js/script.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

                          Severity
                          Category
                          Status
                          Source
                          Language