radare/radare2-webui

View on GitHub

Showing 243 of 2,691 total issues

Function calc has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function calc (addr) {
        if (addr) {
          frame.offset = addr;
        }
        var off = frame.offset || '0';
Severity: Minor
Found in www/t/js/main.js - About 1 hr to fix

    Function handleKeyPress has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        handleKeyPress: function(inSender, inEvent) {
            for (var key in Config.keys) {
                if (key.substring(0, 2) == 'C-') {
                    if (inEvent.ctrlKey) {
                        var k = key.substring(2).charCodeAt(0);
    Severity: Minor
    Found in www/enyo/js/main.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 update_minimap has a Cognitive Complexity of 14 (exceeds 5 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

    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 reposition_graph has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    function reposition_graph() {
        var bbs = r2ui.graph.getElements();
        var blocks = r2ui.get_fcn_BBs(r2ui.current_fcn_offset);
        var bb_offsets = Object.keys(blocks);
        for (var i in bbs) {
    Severity: Minor
    Found in www/lib/disasm.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 iterate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        VisibleNodeIterator.prototype.iterate = function() {
          var is_first_node, _iterateNode;
          is_first_node = true;
          _iterateNode = (function(_this) {
            return function(node, next_node) {
    Severity: Minor
    Found in www/p/lib/js/dependencies/tree.jquery.js - About 1 hr to fix

      Function on_scroll has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function on_scroll(event) {
          // console.log($(event.target).scrollTop());
          if (!r2ui._dis.scrolling) {
              var enyo = $('#radareApp').length ? true : false;
              var panel_disas = false;
      Severity: Minor
      Found in www/lib/disasm.js - About 1 hr to fix

        Function populateFrom has 42 lines of code (exceeds 25 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 1 hr to fix

          Function save has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              save: function() {
                  var use_new_view = this.$.use_new_view.active;
                  var show_offset = this.$.toggle_offset.active;
                  var arch = this.$.arch.selected.content;
                  var bits = this.$.bits.selected.content;
          Severity: Minor
          Found in www/enyo/js/settings.js - About 1 hr to fix

            Function drawContent has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                drawContent(dom, callback) {
                    dom.innerHTML = '';
            
                    this.listContent = document.createElement('ul');
                    this.listContent.className = 'listContent';
            Severity: Minor
            Found in www/m/js/modules/hexdump/Hexdump.js - About 1 hr to fix

              Function highlight_instruction has 40 lines of code (exceeds 25 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 1 hr to fix

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

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

                  Function createChart has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      createChart(name, title, color, value, onclick) {
                          const xmlns = "http://www.w3.org/2000/svg";
                          const svg = document.createElementNS(xmlns, 'svg');
                          svg.setAttribute('class', 'demo-chart mdl-cell mdl-cell--4-col mdl-cell--3-col-desktop');
                          svg.setAttribute('fill', 'currentColor');
                  Severity: Minor
                  Found in www/m/js/modules/overview/GraphCard.js - About 1 hr to fix

                    Function del_frame has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      this.del_frame = function (name) {
                        var prev = undefined;
                        if (!name && this.curframe) {
                          name = this.curframe[0].name;
                        }
                    Severity: Minor
                    Found in www/t/js/tiled.js - About 1 hr to fix

                      Function getChunk has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getChunk(howManyBytes, addr, nbCols) {
                          if (addr < 0) {
                              return {
                                  offset: 0,
                                  hex: [],
                      Severity: Minor
                      Found in www/m/workers/hexchunkProvider.js - About 1 hr to fix

                        Function on_hex_scroll has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function on_hex_scroll() {
                            if (!r2ui._hex.scrolling) {
                                r2ui._hex.scrolling = true;
                                var scroll_offset = $('#center_panel').scrollTop();
                                var top_offset = $('.hexoffset').height() - $('#center_panel').height();
                        Severity: Minor
                        Found in www/p/lib/js/panels/hex_panel.js - About 1 hr to fix

                          Function draw has 38 lines of code (exceeds 25 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 1 hr to fix

                            Function modalShell has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function modalShell () {
                              var body = html.div('modal_body');
                              var out = html.div('modal_output', '', {
                                overflow: 'hidden',
                                backgroundColor: 'red',
                            Severity: Minor
                            Found in www/t/js/modals.js - About 1 hr to fix

                              Function colorizeFlag has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

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

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

                                    do_rename: function(element) {
                                        if (this.renaming === null && this.selected !== null && this.selected.className.indexOf(' addr ') > -1) {
                                            var address = get_address_from_class(this.selected);
                                            this.renaming = this.selected;
                                            this.renameOldValue = this.selected.innerHTML;
                                Severity: Minor
                                Found in www/enyo/js/disassembler.js - About 1 hr to fix

                                  Function getFlags has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      getFlags(minSize, callback) {
                                          var filter = function(flags) {
                                              var filteredFlags = [];
                                              for (var i = 0 ; i < flags.length ; i++) {
                                                  if (flags[i].size >= minSize) {
                                  Severity: Minor
                                  Found in www/m/js/modules/hexdump/HexPairNavigator.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language