radare/radare2-webui

View on GitHub

Showing 243 of 2,691 total issues

Function seek has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

r2ui.seek = function(addr, push, scroll) {
    if (addr === undefined) return;
    // Resolve flag in case we dont have an address
    if (addr.indexOf('0x') === 0) {
        addr = address_canonicalize(addr);
Severity: Minor
Found in www/lib/r2ui.js - About 35 mins 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 getChunk has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getChunk(where, howManyLines) {
    var raw;

    let scrColor = 3;
    // TODO var a = r2Settings.getItem(r2Settings.keys.BYTES)
Severity: Minor
Found in www/m/workers/disasmProvider.js - About 35 mins 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_address_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

r2.get_address_type = function(address) {
    var offset = parseInt(address, 16);
    for (var i in r2.sections) {
        if (offset >= r2.sections[i].addr && offset < r2.sections[i].addr + r2.sections[i].size) {
            if (r2.sections[i].flags.indexOf('x') > -1) {
Severity: Minor
Found in www/lib/r2.js - About 35 mins 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

Avoid too many return statements within this function.
Open

            return null;
Severity: Major
Found in www/p/lib/js/dependencies/tree.jquery.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

              return (partial.length === 0 ? '{}' : '{' + partial.join(',') + '}');
    Severity: Major
    Found in www/p/lib/js/dependencies/tree.jquery.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return true;
      Severity: Major
      Found in www/lib/r2.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return '<span class=\'ec_dataoffset\'>' + a + '</span>';
        Severity: Major
        Found in www/lib/disasm.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return reps[a];
          Severity: Major
          Found in www/lib/disasm.js - About 30 mins to fix

            Function scroll_to_address has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function scroll_to_address(address, pos) {
                if (address === undefined || address === null) return;
                var offset = 0;
                if (pos == 'top') offset = $('#center_panel').height();
                else if (pos == 'bottom') offset = 0;
            Severity: Minor
            Found in www/p/lib/js/panels/disasm_panel.js - About 25 mins 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 speak has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export function speak(text, callback) {
                if (!r2Settings.getItem(r2Settings.keys.USE_TTS)) {
                    return;
                }
            
            
            Severity: Minor
            Found in www/m/js/helpers/Speak.js - About 25 mins 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 analyse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                analyse() {
                    let atLeastOneChecked = false;
                    for (let i in this.analysisMethods)
                    {
                        const method = this.analysisMethods[i];
            Severity: Minor
            Found in www/m/js/modules/overview/AnalysisCard.js - About 25 mins 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 statusFullscreen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function statusFullscreen() {
                var statusbar = document.getElementById('statusbar');
                var container = document.getElementById('container');
                if (statusMode === Mode.FULL) {
                    statusMode = Mode.HALF;
            Severity: Minor
            Found in www/m/js/helpers/statusbar/statusbar.legacy.js - About 25 mins 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 uiTableRow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function uiTableRow(cols) {
                var type = '';
                var out = '<tr>';
                for (var i in cols) {
                    var col = cols[i];
            Severity: Minor
            Found in www/m/js/helpers/uiTables.legacy.js - About 25 mins 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 goToAddress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            DisasmPanel.prototype.goToAddress = function() {
                if (this.renaming === null && this.selected !== null && (this.selected.className.indexOf(' addr ') > -1)) {
                    var address = get_address_from_class(this.selected);
                    if (this.selected.className.indexOf('ec_gui_dataoffset') > -1) {
                        // address is located in not executable memory, switching to hex view
            Severity: Minor
            Found in www/p/lib/js/panels/disasm_panel.js - About 25 mins 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 drawControls has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                drawControls(dom) {
                    dom.innerHTML = '';
            
                    var controlList = document.createElement('ul');
                    controlList.classList.add('controlList');
            Severity: Minor
            Found in www/m/js/modules/hexdump/Hexdump.js - About 25 mins 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 itemSelected has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                itemSelected: function(inSender, inEvent) {
                    if (inEvent.originator.content) {
                        var itemContent = inEvent.originator.content;
                        if (itemContent == 'rename') {
                            this.do_rename(this.selected, inEvent);
            Severity: Minor
            Found in www/enyo/js/disassembler.js - About 25 mins 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 statusToggle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function statusToggle() {
                var statusbar = document.getElementById('statusbar');
                var container = document.getElementById('container');
            
                if (statusMode === Mode.HALF) {
            Severity: Minor
            Found in www/m/js/helpers/statusbar/statusbar.legacy.js - About 25 mins 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 rename has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function rename(offset, old_value, new_value, space) {
                if (space === undefined) space = 'functions';
                if (space == 'functions') {
                    // If current offset is the beginning of a function, rename it with afr
                    r2.cmdj('pdfj @ ' + offset + '|', function(x) {
            Severity: Minor
            Found in www/lib/disasm.js - About 25 mins 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 addVertex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            BBGraph.prototype.addVertex = function(addr, vlen, dom) {
                // if vertex is not yet created, do it
                if (this.vertices[addr] === undefined) {
                    this.vertices[addr] = {};
                    this.vertices[addr].parents = [];
            Severity: Minor
            Found in www/lib/disasm.js - About 25 mins 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 drawTitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                drawTitle(separator = ' & ') {
                    this.titleNode.innerHTML = '';
                    for (let i = 0 ; i < this.displayedWidgets.length ; i++) {
                        const widget = this.displayedWidgets[i];
                        const isActiveOne = widget === this.focusedWidget && this.displayedWidgets.length > 1;
            Severity: Minor
            Found in www/m/js/core/UIContext.js - About 25 mins 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

            Severity
            Category
            Status
            Source
            Language