radare/radare2-webui

View on GitHub

Showing 243 of 2,691 total issues

File main.js has 322 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var myLayout;

$(document).ready(function() {

    r2.cmd('e scr.html=false');
Severity: Minor
Found in www/p/lib/js/main.js - About 3 hrs to fix

    Function render_functions has a Cognitive Complexity of 25 (exceeds 5 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 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 handleKeypress has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function handleKeypress(inEvent) {
        var keynum = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
        var key = String.fromCharCode(keynum);
        // console.log(key);
    
    
    Severity: Major
    Found in www/p/lib/js/panels/disasm_panel.js - About 3 hrs to fix

      Function new_frame has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        this.new_frame = function (name, body, update, pos, cb) {
          var nf = {};
          nf.name = name = name || this.defname();
      
          var obj_title = document.createElement('div');
      Severity: Major
      Found in www/t/js/tiled.js - About 3 hrs to fix

        Function filter_asm has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        r2.filter_asm = function(x, display) {
            var curoff = backward ? prev_curoff : next_curoff;
            var lastoff = backward ? prev_lastoff : next_lastoff;
            var lines = x.split(/\n/g);
            r2.cmd('s', function(x) {
        Severity: Major
        Found in www/lib/r2.js - About 3 hrs to fix

          `` has 29 functions (exceeds 20 allowed). Consider refactoring.
          Open

          enyo.kind({
              name: 'MainPanel',
              classes: 'onyx',
              kind: 'FittableRows',
              classes: 'enyo-fit',
          Severity: Minor
          Found in www/enyo/js/mainpanel.js - About 3 hrs to fix

            File mainpanel.js has 311 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            enyo.kind({
                name: 'MainPanel',
                classes: 'onyx',
                kind: 'FittableRows',
                classes: 'enyo-fit',
            Severity: Minor
            Found in www/enyo/js/mainpanel.js - About 3 hrs to fix

              Hexdump has 28 functions (exceeds 20 allowed). Consider refactoring.
              Open

              export class Hexdump extends RadareInfiniteBlock {
                  
                  constructor(containerElement, lineHeight, isBigEndian) {
                      super();
                      this.container = new FlexContainer(containerElement, 'hex');
              Severity: Minor
              Found in www/m/js/modules/hexdump/Hexdump.js - About 3 hrs to fix

                Function _loadDataFromUrl has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    JqTreeWidget.prototype._loadDataFromUrl = function(url_info, parent_node, on_finished) {
                      var $el, addLoadingClass, handeLoadData, loadDataFromUrlInfo, parseUrlInfo, removeLoadingClass;
                      $el = null;
                      addLoadingClass = (function(_this) {
                        return function() {
                Severity: Major
                Found in www/p/lib/js/dependencies/tree.jquery.js - About 3 hrs to fix

                  Function getTextLogger has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                  r2.getTextLogger = function(obj) {
                      if (typeof (obj) != 'object') {
                          obj = {};
                      }
                      obj.last = 0;
                  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 on_scroll has a Cognitive Complexity of 23 (exceeds 5 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 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 beforeOpen has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              beforeOpen: function(event, ui) {
                                  var address = get_address_from_class(ui.target[0]);
                                  var xrefs_to = [];
                                  var xrefs_from = [];
                                  var xrefto_submenu = null;
                  Severity: Major
                  Found in www/p/lib/js/panels/disasm_panel.js - About 3 hrs to fix

                    Function newDisasmFrame has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function newDisasmFrame () {
                        var n = t.defname('disas');
                        var disasmbody = '<div id=\'' + n + '_code\' class=\'frame_body\'></div>';
                        t.new_frame(n, disasmbody, function (obj) {
                          var code = _(n + '_code');
                    Severity: Major
                    Found in www/t/js/main.js - About 3 hrs to fix

                      Function render_graph has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function render_graph(x) {
                          var obj;
                          try {
                              obj = JSON.parse(x.replace(/\\l/g, '\\n'));
                          } catch (e) {
                      Severity: Major
                      Found in www/lib/disasm.js - About 3 hrs to fix

                        Function register has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            SimpleWidget.register = function(widget_class, widget_name) {
                              var callFunction, createWidget, destroyWidget, getDataKey, getWidgetData;
                              getDataKey = function() {
                                return "simple_widget_" + widget_name;
                              };
                        Severity: Major
                        Found in www/p/lib/js/dependencies/tree.jquery.js - About 2 hrs to fix

                          Function newHexdumpFrame has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function newHexdumpFrame () {
                              var n = t.defname('hexdump');
                              var msgbody = '<div id=\'' + n + '_hexdump\' class=\'frame_body\'></div>';
                              t.new_frame(n, msgbody, function (obj) {
                                var code = _(n + 'code');
                          Severity: Major
                          Found in www/t/js/main.js - About 2 hrs to fix

                            Function drawPairs_ has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                            Open

                                drawPairs_(hexpairs, asciis, pairs, chars, modifications, offset) {
                                    hexpairs.classList.add('pairs');
                            
                                    var editableHexEvent = {
                                        keydown: (evt) => evt.keyCode === 13 && collectHexpair(evt.target),
                            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 get has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                            Open

                                get(which, callback, force) {
                                    var dir = (which === NavigatorDirection.BEFORE) ? 'prev' : 'next';
                            
                                    var item;
                                    if (which === NavigatorDirection.CURRENT) {
                            Severity: Minor
                            Found in www/m/js/core/BlockNavigator.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

                            Disassembly has 25 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            export class Disassembly extends RadareInfiniteBlock {
                            
                                constructor(containerElement, lineHeight) {
                                    super();
                                    this.container = new FlexContainer(containerElement, 'disasm');
                            Severity: Minor
                            Found in www/m/js/modules/disasm/Disassembly.js - About 2 hrs to fix

                              Function newDebugFrame has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function newDebugFrame () {
                                  var name = 'debug';
                                  var n = t.defname(name);
                                  var fillFrame = function () {
                                    // TODO: list breakpoints with `dbj`
                              Severity: Major
                              Found in www/t/js/main.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language