radare/radare2-webui

View on GitHub

Showing 243 of 2,691 total issues

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

r2.get_flag_address = function(name) {
    for (var f in r2.flags) {
        for (var v in r2.flags[f]) {
            if (name == r2.flags[f][v].name) return f;
        }
Severity: Minor
Found in www/lib/r2.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 cmds has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

r2.cmds = function(cmds, cb) {
    if (cmds.length == 0) return;
    var cmd = cmds[0];
    cmds = cmds.splice(1);
    function lala() {
Severity: Minor
Found in www/lib/r2.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 getItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    getItem(key) {
        if (!this.keyExists(key)) throw new Error(`ConfKey ${key} doesn't exist!`);
        
        var local = localStorage.getItem(key);
        if (local !== null) {
Severity: Minor
Found in www/m/js/core/SettingsManager.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