radare/radare2-webui

View on GitHub

Showing 2,691 of 2,691 total issues

Function createExportDialog has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    createExportDialog(label, output, save) {
        var dialog = document.createElement('dialog');
        dialog.className = 'mdl-dialog';

        if (!dialog.showModal) {
Severity: Minor
Found in www/m/js/modules/hexdump/Hexdump.js - About 1 hr to fix

    Function drawChunk has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        drawChunk(chunk, domAnchor) {
            domAnchor.innerHTML = chunk.data;
            // TODO Dirty workaround, see with worker usage
            const seekableElements = domAnchor.getElementsByClassName('r2seek');
            for (const el of seekableElements) {
    Severity: Minor
    Found in www/m/js/modules/disasm/Disassembly.js - About 1 hr to fix

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

        Function handle_hex_double_click has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        function handle_hex_double_click(inEvent) {
            // handle offset seek
            if ($(inEvent.target).hasClass('hexaddr')) {
                var address = get_address_from_class(inEvent.target, 'hexaddr');
                console.log(address);
        Severity: Minor
        Found in www/p/lib/js/panels/hex_panel.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 selectRange has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        function selectRange() {
            $('span.dword').removeClass('autohighlighti');
            if (r2ui._hex.dragEnd + 1 < r2ui._hex.dragStart) { // reverse select
                var cells = $('span.dword').slice(r2ui._hex.dragEnd, r2ui._hex.dragStart + 1).addClass('autohighlighti');
                for (var i in cells) {
        Severity: Minor
        Found in www/p/lib/js/panels/hex_panel.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 keyHandler has a Cognitive Complexity of 12 (exceeds 5 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

        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 dragElement has 35 lines of code (exceeds 25 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 1 hr to fix

          Function statusNext has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function statusNext() {
              var statusbar = document.getElementById('statusbar');
              var container = document.getElementById('container');
              switch (statusMode) {
              case Mode.LINE:
          Severity: Minor
          Found in www/m/js/helpers/statusbar/statusbar.legacy.js - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            enyo.kind({
                name: 'Search',
                kind: 'Scroller',
                style: 'background-color:#303030',
                components: [
            Severity: Major
            Found in www/enyo/js/search.js and 1 other location - About 1 hr to fix
            www/enyo/js/debugger.js on lines 1..10

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 63.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            enyo.kind({
                name: 'Debugger',
                kind: 'Scroller',
                style: 'background-color:#303030',
                components: [
            Severity: Major
            Found in www/enyo/js/debugger.js and 1 other location - About 1 hr to fix
            www/enyo/js/search.js on lines 1..10

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 63.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

                drawControls(dom) {
                    dom.innerHTML = '';
            
                    const more = Inputs.iconButton('list', 'Others representations');
                    more.id = 'disasm_more';
            Severity: Minor
            Found in www/m/js/modules/disasm/Disassembly.js - About 1 hr to fix

              Function BBGraph has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Function onkeyup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _('body').onkeyup = function (e) {
                    if (t.modal) {
                      return;
                    }
                    var key = String.fromCharCode(e.keyCode);
                Severity: Minor
                Found in www/t/js/main.js - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                            q.onclick = function () {
                              r2.cmd('s-512;s', function (res) {
                                frame.offset = res.trim();
                                frame.refresh();
                              });
                  Severity: Major
                  Found in www/t/js/main.js and 1 other location - About 1 hr to fix
                  www/t/js/main.js on lines 430..435

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                            q2.onclick = function () {
                              r2.cmd('s+512;s', function (res) {
                                frame.offset = res.trim();
                                frame.refresh();
                              });
                  Severity: Major
                  Found in www/t/js/main.js and 1 other location - About 1 hr to fix
                  www/t/js/main.js on lines 423..428

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      r2.get_disasm (addr, this.block, function (x) {
                        x = docss (r2.filter_asm (x, "pd"));
                        text.setContent("<div class='enyo-selectable'>" + x + "</div>");
                      });
                  Severity: Major
                  Found in www/enyo/js/core/disassembler_old.js and 1 other location - About 1 hr to fix
                  www/enyo/js/hexdump.js on lines 52..55

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          r2.get_hexdump(addr, this.block, function(x) {
                              x = docss(r2.filter_asm(x, 'px'));
                              text.setContent('<div class=\'enyo-selectable\'>' + x + '</div>');
                          });
                  Severity: Major
                  Found in www/enyo/js/hexdump.js and 1 other location - About 1 hr to fix
                  www/enyo/js/core/disassembler_old.js on lines 46..49

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Function getState has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      SaveStateHandler.prototype.getState = function() {
                        var getOpenNodeIds, getSelectedNodeIds;
                        getOpenNodeIds = (function(_this) {
                          return function() {
                            var open_nodes;
                  Severity: Minor
                  Found in www/p/lib/js/dependencies/tree.jquery.js - About 1 hr to fix

                    Function startHandler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function startHandler(event)
                        {
                            var $elem = jQuery(this);
                    
                            // Merge the defaults and any user defined settings.
                    Severity: Minor
                    Found in www/p/lib/js/dependencies/taphold.js - About 1 hr to fix

                      Function newHelpFrame has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function newHelpFrame () {
                          var n = t.defname('help');
                          function newthing (name) {
                            // TODO: disas_code id
                            setTimeout(function () {
                      Severity: Minor
                      Found in www/t/js/main.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language