Showing 243 of 2,691 total issues
Function setStatusbarBody
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function setStatusbarBody() {
function addElement(e, id) {
var doc = document.createElement(e);
doc.id = id;
doc.className = id;
- 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 drawContextualMenu
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
drawContextualMenu() {
var exportOp = (name, range, command, ext) => {
var output;
r2.cmd(command + ' ' + (range.to - range.from) + ' @' + range.from, (d) => { output = d; });
- 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 drawChunk
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
drawChunk(chunk, where) {
if (chunk.offset === 0 && chunk.hex.length === 0) {
return this.firstElement;
}
- 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 hex_menu_to_console
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function hex_menu_to_console() {
value = '';
if (r2ui._hex.dragEnd > -1 && r2ui._hex.dragStart > -1) {
if (r2ui._hex.dragEnd + 1 < r2ui._hex.dragStart) { // reverse select
var cells = $('span.dword').slice(r2ui._hex.dragEnd, r2ui._hex.dragStart + 1).addClass('autohighlighti');
- 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 handleInputTextChange
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
DisasmPanel.prototype.handleInputTextChange = function() {
if (this.renaming !== null && this.rbox.value.length > 0) {
if ($(this.selected).hasClass('insaddr')) {
var old_value = get_offset_flag(r2ui._dis.selected_offset);
var type = 'offsets';
Function getPanel
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPanel() {
var c = document.createElement('div');
var header = document.createElement('div');
header.style.position = 'fixed';
Function drawEmptyDialog
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawEmptyDialog() {
var _this = this;
this.dialog = document.createElement('dialog');
this.dialog.className = 'mdl-dialog';
Function createTree
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
TypesPanel.prototype.createTree = function() {
var $tree = $('#types');
$tree.tree({
data: this.data,
slide: false,
Function render_functions
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function render_functions(functions) {
var imports = null;
r2.cmdj('iij', function(x) {
imports = x;
});
Function handleInputTextChange
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleInputTextChange: function() {
if (this.renaming !== null && this.rbox.value.length > 0) {
if ($(this.selected).hasClass('insaddr')) {
var old_value = get_offset_flag(r2ui._dis.selected_offset);
var type = 'offsets';
Function goToAddress
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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_dataoffset') > -1) {
// address is located in not executable memory, switching to hex view
Function _init
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
JqTreeWidget.prototype._init = function() {
JqTreeWidget.__super__._init.call(this);
this.element = this.$el;
this.mouse_delay = 300;
this.is_initialized = false;
Function openPage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
openPage: function(idx) {
var str, sp = this.$.panels;
// TODO: this is just a hack
var r = -1;
switch (idx) {
Function applyFlags
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
applyFlags(lines, blockInitialOffset, flags) {
if (!this.showFlags) {
return;
}
Function moveItem
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
DragAndDropHandler.prototype.moveItem = function(position_info) {
var doMove, event, moved_node, position, previous_parent, target_node;
if (this.hovered_area && this.hovered_area.position !== Position.NONE && this.canMoveToArea(this.hovered_area)) {
moved_node = this.current_item.node;
target_node = this.hovered_area.node;
Function infiniteDrawingContent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
infiniteDrawingContent(where, pos, endCallback) {
this.nav.get(where, (chunk) => {
if (where === NavigatorDirection.BEFORE) {
this.isTopMax = chunk.offset === 0;
} else {
Function new_modal
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.new_modal = function (name, body, items, cb) {
var title = html.div('modal_title', 'modal_title', {
backgroundColor: '#c0c0c0',
display: 'inline',
overflowX: 'hidden'
Function getSlot
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
getSlot(widget) {
let widgetIndex = this.displayedWidgets.indexOf(widget);
if (~widgetIndex) { // We want a slot for an already displayed widget
return this.contentNode.children[widgetIndex];
}
Function get
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
get(offset, size, callback) {
// TODO: retrieve data (async) and call
var item;
for (var i = 0 ; i < this.items.length ; i++) {
if (this.items[i].offset === offset &&
Function onmessage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.providerWorker.onmessage = function(e) {
if (e.data.dir === NavigatorDirection.CURRENT) {
if (typeof _this.curChunk.data.callback !== 'undefined') {
for (var i = 0 ; i < _this.curChunk.data.callback.length ; i++) {
_this.curChunk.data.callback[i](e.data);