radare/radare2-webui

View on GitHub

Showing 244 of 2,705 total issues

Function html_for_instruction has 148 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function html_for_instruction(ins) {
    var idump = '<div class="instruction enyo-selectable">';
    var offset = '0x' + ins.offset.toString(16);
    var address = offset;
    var asm_flags = (r2.settings['asm.flags']);
Severity: Major
Found in www/lib/disasm.js - About 5 hrs to fix

    Function drawContextualMenu has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        drawContextualMenu(enableAoj) {
            var _this = this;
    
            var displayRes = function(offset, cmd) {
                var output;
    Severity: Major
    Found in www/m/js/modules/disasm/Disassembly.js - About 5 hrs to fix

      Function render has 144 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      DisasmPanel.prototype.render = function(mode) {
      
          // r2ui.seek("$$", false);
          $('#center_panel').unbind('click');
          $(document).unbind('keypress');
      Severity: Major
      Found in www/p/lib/js/panels/disasm_panel.js - About 5 hrs to fix

        Function load_colors has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

        r2ui.load_colors = function() {
            // change css on the fly!
            r2.cmdj('ecj', function(x) {
                for (var i in x) {
                    r2ui.colors['.ec_' + i.replace('gui.', 'gui_')] = 'rgb(' + String(x[i]) + ')';
        Severity: Minor
        Found in www/lib/r2ui.js - About 5 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_instructions has 141 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function render_instructions(instructions) {
            var outergbox = document.createElement('div');
            outergbox.id = 'outergbox';
            var flatcanvas = document.getElementById('canvas');
            flatcanvas.innerHTML = '';
        Severity: Major
        Found in www/lib/disasm.js - About 5 hrs to fix

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

          DisasmPanel.prototype.render = function(mode) {
          
              // r2ui.seek("$$", false);
              $('#center_panel').unbind('click');
              $(document).unbind('keypress');
          Severity: Minor
          Found in www/p/lib/js/panels/disasm_panel.js - About 5 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 handleClick has a Cognitive Complexity of 37 (exceeds 5 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: Minor
          Found in www/p/lib/js/panels/disasm_panel.js - About 5 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 onload has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

          window.onload = function () {
            var position = 'right';
            var t = new Tiled('canvas');
            var ctr = 0;
            r2.cmd('e scr.color=3;eco sepia;e scr.html=true', function () {
          Severity: Minor
          Found in www/t/js/main.js - About 5 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 drawAnalysisDialog has 129 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              drawAnalysisDialog() {
                  this.analysisMethods = [{
                      name: 'Analyse current offset',
                      ugly: 'curoffset',
                      active: true,
          Severity: Major
          Found in www/m/js/modules/disasm/Disassembly.js - About 5 hrs to fix

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

                drawControls(dom) {
                    dom.innerHTML = '';
            
                    var controlList = document.createElement('ul');
                    controlList.classList.add('controlList');
            Severity: Major
            Found in www/m/js/modules/hexdump/Hexdump.js - About 4 hrs to fix

              Function render has 121 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              StringsPanel.prototype.render = function() {
                  $('#strings_tab').html('<div id="strings" style="color:rgb(127,127,127);"></div>');
                  //Added String search bar and length bar
                  $('#strings').before('<div class="ui-toolbar ui-widget-header ui-helper-clearfix" style="padding:5px;"><input id="search_string" type="text" placeholder="Search "><input id="string_length" type="text" placeholder="Length" style="margin-left:50px;"></div>');
                  r2.cmdj('izj', function(strings) {
              Severity: Major
              Found in www/p/lib/js/panels/strings_panel.js - About 4 hrs to fix

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

                    drawContextualMenu(enableAoj) {
                        var _this = this;
                
                        var displayRes = function(offset, cmd) {
                            var output;
                Severity: Minor
                Found in www/m/js/modules/disasm/Disassembly.js - About 4 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

                File hex_panel.js has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // HEXDUMP PANEL
                var HexPanel = function() {
                    this.block = 1024;
                    this.base = 'entry0';
                    this.first = 0;
                Severity: Minor
                Found in www/p/lib/js/panels/hex_panel.js - About 4 hrs to fix

                  Function configureWorker_ has a Cognitive Complexity of 30 (exceeds 5 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 4 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 handleKeyPress has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      handleKeyPress: function(inSender, inEvent) {
                          var keynum = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
                          var key = String.fromCharCode(keynum);
                          // console.log(key);
                  
                  
                  Severity: Major
                  Found in www/enyo/js/disassembler.js - About 4 hrs to fix

                    Function render_graph has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function render_graph(x) {
                        var obj;
                        try {
                            obj = JSON.parse(x.replace(/\\l/g, '\\n'));
                        } catch (e) {
                    Severity: Minor
                    Found in www/lib/disasm.js - About 4 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 104 lines of code (exceeds 25 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: Major
                    Found in www/lib/disasm.js - About 4 hrs to fix

                      Function tile has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        this.tile = function () {
                          if (this.modal) {
                            var mtop = topmargin;
                            var left = 0;
                            var width = w - (w / 20);
                      Severity: Major
                      Found in www/t/js/tiled.js - About 3 hrs to fix

                        Function Ajax has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function Ajax(method, uri, body, fn, err) {
                            if (typeof (XMLHttpRequest) == 'undefined') {
                                return false;
                            }
                            if (r2.asyncMode == 'fake') {
                        Severity: Minor
                        Found in www/lib/r2.js - About 3 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 highlight_instruction has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function highlight_instruction(line, instruction) {
                            if (line === undefined) return 'undefined';
                            if (instruction === undefined) instruction = true;
                            var ret = escapeHTML(line);
                        
                        
                        Severity: Minor
                        Found in www/lib/disasm.js - About 3 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

                        Severity
                        Category
                        Status
                        Source
                        Language