radare/radare2-webui

View on GitHub

Showing 244 of 2,705 total issues

File tree.jquery.js has 2649 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Generated by CoffeeScript 1.7.1
(function() {
  var $, BorderDropHint, DragAndDropHandler, DragElement, ElementsRenderer, FolderElement, GhostDropHint, HitAreasGenerator, JqTreeWidget, KeyHandler, MouseWidget, Node, NodeElement, Position, SaveStateHandler, ScrollHandler, SelectNodeHandler, SimpleWidget, VisibleNodeIterator, get_json_stringify_function, html_escape, indexOf, isInt, __version__, _indexOf,
    __slice = [].slice,
    __hasProp = {}.hasOwnProperty,
Severity: Major
Found in www/p/lib/js/dependencies/tree.jquery.js - About 1 wk to fix

    Function Tiled has a Cognitive Complexity of 251 (exceeds 5 allowed). Consider refactoring.
    Open

    function Tiled (id) {
      var obj = document.getElementById(id);
      var self = this;
      this.modal = null;
      this.curframe = undefined;
    Severity: Minor
    Found in www/t/js/tiled.js - About 5 days 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 507 lines of code (exceeds 25 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: Major
    Found in www/t/js/main.js - About 2 days to fix

      File disasm.js has 995 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var BBGraph = function() {
          this.vertices = {};
          this.edges = [];
          this.elements = [];
          this.links = [];
      Severity: Major
      Found in www/lib/disasm.js - About 2 days to fix

        File Hexdump.js has 939 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {HexPairNavigator} from './HexPairNavigator';
        import {NavigatorDirection} from '../../core/NavigatorDirection';
        import {RadareInfiniteBlock} from '../../layout/RadareInfiniteBlock';
        import {FlexContainer} from '../../layout/FlexContainer';
        import {WordSizes} from './WordSizes';
        Severity: Major
        Found in www/m/js/modules/hexdump/Hexdump.js - About 2 days to fix

          Function Tiled has 437 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Tiled (id) {
            var obj = document.getElementById(id);
            var self = this;
            this.modal = null;
            this.curframe = undefined;
          Severity: Major
          Found in www/t/js/tiled.js - About 2 days to fix

            Function html_for_instruction has a Cognitive Complexity of 88 (exceeds 5 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: Minor
            Found in www/lib/disasm.js - About 1 day 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 a Cognitive Complexity of 75 (exceeds 5 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: Minor
            Found in www/enyo/js/disassembler.js - About 1 day 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 Disassembly.js has 657 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {DisassemblyNavigator} from './DisassemblyNavigator';
            import {RadareInfiniteBlock} from '../../layout/RadareInfiniteBlock';
            import {FlexContainer} from '../../layout/FlexContainer';
            
            import {uiContext} from '../../core/UIContext';
            Severity: Major
            Found in www/m/js/modules/disasm/Disassembly.js - About 1 day to fix

              Function handleKeypress has a Cognitive Complexity of 69 (exceeds 5 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: Minor
              Found in www/p/lib/js/panels/disasm_panel.js - About 1 day 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 a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
              Open

              function render_instructions(instructions) {
                  var outergbox = document.createElement('div');
                  outergbox.id = 'outergbox';
                  var flatcanvas = document.getElementById('canvas');
                  flatcanvas.innerHTML = '';
              Severity: Minor
              Found in www/lib/disasm.js - About 1 day 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 r2.js has 567 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* radare2 Copyleft 2013-2016 pancake */
              
              var r2 = {};
              
              // TODO: avoid globals
              Severity: Major
              Found in www/lib/r2.js - About 1 day to fix

                Function filter_asm has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                Open

                r2.filter_asm = function(x, display) {
                    var curoff = backward ? prev_curoff : next_curoff;
                    ;
                    var lastoff = backward ? prev_lastoff : next_lastoff;
                    ;
                Severity: Minor
                Found in www/lib/r2.js - About 1 day 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 main.js has 533 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                
                function findPos (obj) {
                  var curtop = 0;
                  var curleft = 0;
                  if (obj.offsetParent) {
                Severity: Major
                Found in www/t/js/main.js - About 1 day to fix

                  File disasm_panel.js has 531 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // DISASSEMBLER PANEL
                  var DisasmPanel = function() {
                      this.display = 'flat';
                      this.min = 0;
                      this.max = 0;
                  Severity: Major
                  Found in www/p/lib/js/panels/disasm_panel.js - About 1 day to fix

                    File disassembler.js has 490 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    enyo.kind({
                        name: 'Disassembler',
                        kind: 'Scroller',
                        tag: 'div',
                        classes: 'ec_gui_background',
                    Severity: Minor
                    Found in www/enyo/js/disassembler.js - About 7 hrs to fix

                      Function handleTap has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                      Open

                          handleTap: function(inSender, inEvent) {
                              if (typeof inEvent.target.className === 'string') {
                                  if (inEvent.target.className.indexOf(' addr ') > -1) {
                                      var address = get_address_from_class(inEvent.target);
                                      rehighlight_iaddress(address);
                      Severity: Minor
                      Found in www/enyo/js/disassembler.js - About 7 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 tiled.js has 487 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      function _ (x) { return document.getElementById(x); }
                      
                      var html = {
                        text: function (text) {
                          var o = document.createElement('font');
                      Severity: Minor
                      Found in www/t/js/tiled.js - About 7 hrs to fix

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

                            drawContextualMenu() {
                                var exportOp = (name, range, command, ext) => {
                                    var output;
                                    r2.cmd(command + ' ' + (range.to - range.from) + ' @' + range.from, (d) => { output = d; });
                        
                        
                        Severity: Major
                        Found in www/m/js/modules/hexdump/Hexdump.js - About 6 hrs to fix

                          Function drawPairs_ has 152 lines of code (exceeds 25 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: Major
                          Found in www/m/js/modules/hexdump/Hexdump.js - About 6 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language