radare/radare2-webui

View on GitHub

Showing 2,691 of 2,691 total issues

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

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

            if (get_more_instructions) {
                r2ui.seek(address, false);
            } else {
                r2ui.history_push(address);
                render_history();
Severity: Major
Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 hr to fix
www/p/lib/js/panels/disasm_panel.js on lines 417..424

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 70.

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

            if (get_more_instructions) {
                r2ui.seek(address, false);
            } else {
                r2ui.history_push(address);
                render_history();
Severity: Major
Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 hr to fix
www/p/lib/js/panels/disasm_panel.js on lines 389..396

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 70.

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 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

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

                  } else {
                      scroll_offset = $('#center_panel').scrollTop();
                      top_offset = $('#gbox').height() - $('#center_panel').height() - 10;
                      container_element = $('#disasm_tab');
                  }
      Severity: Major
      Found in www/lib/disasm.js and 1 other location - About 1 hr to fix
      www/lib/disasm.js on lines 970..974

      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 69.

      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

                  if (enyo) {
                      scroll_offset = $('#main_panel').scrollTop();
                      top_offset = $('#gbox').height() - $('#main_panel').height() - 10;
                      container_element = $('#center_panel');
                  } else {
      Severity: Major
      Found in www/lib/disasm.js and 1 other location - About 1 hr to fix
      www/lib/disasm.js on lines 974..978

      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 69.

      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 3 locations. Consider refactoring.
      Open

              for (var i = 0 ; i < this.smallModifications.length ; i++) {
                  if (this.smallModifications[i].offset === offset) {
                      return this.smallModifications[i].value;
                  }
              }
      Severity: Major
      Found in www/m/js/modules/hexdump/HexPairNavigator.js and 2 other locations - About 1 hr to fix
      www/m/js/modules/disasm/DisassemblyNavigator.js on lines 206..210
      www/m/js/modules/hexdump/Hexdump.js on lines 1150..1154

      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 69.

      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 3 locations. Consider refactoring.
      Open

              for (var i = 0 ; i < this.flagColorAssociation.length ; i++) {
                  if (this.flagColorAssociation[i].name === flagName) {
                      return this.flagColorAssociation[i].color;
                  }
              }
      Severity: Major
      Found in www/m/js/modules/hexdump/Hexdump.js and 2 other locations - About 1 hr to fix
      www/m/js/modules/disasm/DisassemblyNavigator.js on lines 206..210
      www/m/js/modules/hexdump/HexPairNavigator.js on lines 57..61

      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 69.

      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 3 locations. Consider refactoring.
      Open

              for (var i = 0 ; i < this.currentlyShown.length ; i++) {
                  if (this.currentlyShown[i].offset === offset) {
                      return this.currentlyShown[i].size;
                  }
              }
      Severity: Major
      Found in www/m/js/modules/disasm/DisassemblyNavigator.js and 2 other locations - About 1 hr to fix
      www/m/js/modules/hexdump/HexPairNavigator.js on lines 57..61
      www/m/js/modules/hexdump/Hexdump.js on lines 1150..1154

      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 69.

      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 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

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

        r2.get_opcodes = function(off, n, cb) {
            r2.cmd('pdj @' + off + '!' + n + '|', function(json) {
                cb(JSON.parse(json));
            });
        };
        Severity: Major
        Found in www/lib/r2.js and 1 other location - About 1 hr to fix
        www/lib/r2.js on lines 355..359

        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 68.

        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_bytes = function(off, n, cb) {
            r2.cmd('pcj @' + off + '!' + n +'|', function(json) {
                cb(JSON.parse(json));
            });
        };
        Severity: Major
        Found in www/lib/r2.js and 1 other location - About 1 hr to fix
        www/lib/r2.js on lines 349..353

        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 68.

        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

                    q.onclick = function () {
                      r2.cmd('s-512;s', function (res) {
                        frame.offset = res.trim();
                        calc();
                        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 317..323

        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 68.

        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

                    Q.onclick = function () {
                      r2.cmd('s+512;s', function (res) {
                        frame.offset = res.trim();
                        calc();
                        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 309..315

        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 68.

        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 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
                  Severity
                  Category
                  Status
                  Source
                  Language