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);
- Read upRead up
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)
- Read upRead up
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) {
- Read upRead up
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;
Avoid too many return
statements within this function. Open
return (partial.length === 0 ? '{}' : '{' + partial.join(',') + '}');
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return '<span class=\'ec_dataoffset\'>' + a + '</span>';
Avoid too many return
statements within this function. Open
return reps[a];
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;
- Read upRead up
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;
}
- Read upRead up
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];
- Read upRead up
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;
- Read upRead up
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];
- Read upRead up
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
- Read upRead up
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');
- Read upRead up
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);
- Read upRead up
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) {
- Read upRead up
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) {
- Read upRead up
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 = [];
- Read upRead up
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;
- Read upRead up
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"