Showing 243 of 2,691 total issues
Function _openNode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
JqTreeWidget.prototype._openNode = function(node, slide, on_finished) {
var doOpenNode, parent;
if (slide == null) {
slide = true;
}
Function uiSelect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function uiSelect(dom, name, list, defaultOffset, onChange) {
var id = 'select-' + (++selectId);
var div = document.createElement('div');
div.className = 'mdl-selectfield mdl-js-selectfield mdl-selectfield--floating-label';
Function render_hexdump
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function render_hexdump(lines) {
r2ui._hex.scrolling = true;
var hexoffset = '<div class=\'hexoffset\'><div><div>';
var hexdump = '<div class=\'hexdump\' style=\'color: white;\'>';
var hextext = '<div class=\'hextext\'>';
Function keyHandler
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
keyHandler(e) {
if (e.keyCode === ACKeys.UP || e.keyCode === ACKeys.DOWN) {
return this.keyMovement_(e.keyCode);
}
Function getPanel
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPanel() {
const c = document.createElement('div');
var header = document.createElement('div');
header.style.margin = '0.5em';
c.appendChild(header);
Function drawTitle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
drawTitle() {
if (this.currentLayout === Layouts.FULL || this.populatedWidgets.length === 1) {
this.title.innerHTML = this.populatedWidgets[0].getName();
} else {
var titles = [];
- 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 applyFlags
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
applyFlags(lines, blockInitialOffset, flags) {
if (!this.showFlags) {
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 go
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
go(where) {
var goNext = (where === NavigatorDirection.AFTER);
var dir = (goNext) ? 'next' : 'prev';
var howMany = this.gap;
- 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 onkeypress
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
document.body.onkeypress = function(e) {
if (e.ctrlKey) {
const keys = [
// panelConsole,
// panelDisasm,
- 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 deeply nested control flow statements. Open
if (found) {
r2ui.seek_in_graph(address, true);
} else {
r2ui.seek(address, true);
}
Function dragElement
has a Cognitive Complexity of 8 (exceeds 5 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;
- 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 deeply nested control flow statements. Open
if ($('#gbox .instructionbox').index($(r2ui._dis.selected).closest('.instructionbox')[0]) < 10) {
get_more_instructions = true;
address = get_address_from_class(prev_instruction);
}
Function draw
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
draw() {
const nbVals = this.entropy.length;
if (nbVals < 1) {
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
Avoid deeply nested control flow statements. Open
if ($('#gbox .instructionbox').index($(r2ui._dis.selected).closest('.instructionbox')[0]) > $('#gbox .instructionbox').length - 10) {
get_more_instructions = true;
address = get_address_from_class(next_instruction);
}
Avoid deeply nested control flow statements. Open
for (var i in ops) {
if (ops[i].offset === parseInt(address, 16)) {
found = true;
}
}
Function createTree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
TypesPanel.prototype.createTree = function() {
var $tree = $('#types');
$tree.tree({
data: this.data,
slide: false,
- 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 deeply nested control flow statements. Open
if (prev_instruction === undefined || prev_instruction === null) {
prev_instruction = $(r2ui._dis.selected).closest('.basicblock').prev().find('.insaddr').last()[0];
}
Avoid deeply nested control flow statements. Open
if (klass.indexOf('id_') === 0) eid = klass.substring(3);
Avoid deeply nested control flow statements. Open
if (next_instruction === undefined || next_instruction === null) {
next_instruction = $(r2ui._dis.selected).closest('.basicblock').next().find('.insaddr')[0];
}
Function run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
run: function() {
var code = this.$.input.value;
var out = '';
/* helper functions */
function show(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"