Showing 243 of 2,691 total issues
Function html_for_instruction
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
function html_for_instruction(ins) {
var idump = '<div class="instruction enyo-selectable">';
var offset = '0x' + ins.offset.toString(16);
var address = offset;
var asm_flags = (r2.settings['asm.flags']);
Function drawContextualMenu
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawContextualMenu(enableAoj) {
var _this = this;
var displayRes = function(offset, cmd) {
var output;
Function render
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
DisasmPanel.prototype.render = function(mode) {
// r2ui.seek("$$", false);
$('#center_panel').unbind('click');
$(document).unbind('keypress');
Function load_colors
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
r2ui.load_colors = function() {
// change css on the fly!
r2.cmdj('ecj', function(x) {
for (var i in x) {
r2ui.colors['.ec_' + i.replace('gui.', 'gui_')] = 'rgb(' + String(x[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 render_instructions
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
function render_instructions(instructions) {
var outergbox = document.createElement('div');
outergbox.id = 'outergbox';
var flatcanvas = document.getElementById('canvas');
flatcanvas.innerHTML = '';
Function render
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
DisasmPanel.prototype.render = function(mode) {
// r2ui.seek("$$", false);
$('#center_panel').unbind('click');
$(document).unbind('keypress');
- 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 handleClick
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
function handleClick(inEvent) {
if ($(inEvent.target).hasClass('addr')) {
if ($(inEvent.target).hasClass('history')) {
var idx = inEvent.target.className.split(' ').filter(function(x) { return x.substr(0, 'history_idx_'.length) == 'history_idx_'; });
- 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 onload
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
window.onload = function () {
var position = 'right';
var t = new Tiled('canvas');
var ctr = 0;
r2.cmd('e scr.color=3;eco sepia;e scr.html=true', function () {
- 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 drawAnalysisDialog
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawAnalysisDialog() {
this.analysisMethods = [{
name: 'Analyse current offset',
ugly: 'curoffset',
active: true,
Function drawControls
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawControls(dom) {
dom.innerHTML = '';
var controlList = document.createElement('ul');
controlList.classList.add('controlList');
Function render
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
StringsPanel.prototype.render = function() {
$('#strings_tab').html('<div id="strings" style="color:rgb(127,127,127);"></div>');
//Added String search bar and length bar
$('#strings').before('<div class="ui-toolbar ui-widget-header ui-helper-clearfix" style="padding:5px;"><input id="search_string" type="text" placeholder="Search "><input id="string_length" type="text" placeholder="Length" style="margin-left:50px;"></div>');
r2.cmdj('izj', function(strings) {
Function drawContextualMenu
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
drawContextualMenu(enableAoj) {
var _this = this;
var displayRes = function(offset, cmd) {
var output;
- 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
File hex_panel.js
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
// HEXDUMP PANEL
var HexPanel = function() {
this.block = 1024;
this.base = 'entry0';
this.first = 0;
Function configureWorker_
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
configureWorker_() {
var _this = this;
this.providerWorker.onmessage = function(e) {
if (e.data.dir === NavigatorDirection.CURRENT) {
if (typeof _this.curChunk.data.callback !== 'undefined') {
- 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 handleKeyPress
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleKeyPress: function(inSender, inEvent) {
var keynum = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
var key = String.fromCharCode(keynum);
// console.log(key);
Function render_graph
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
function render_graph(x) {
var obj;
try {
obj = JSON.parse(x.replace(/\\l/g, '\\n'));
} catch (e) {
- 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 render
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
BBGraph.prototype.render = function() {
var name = Object.keys(this.vertices).toString();
var outergbox = document.createElement('div');
outergbox.id = 'outergbox';
var bbcanvas = document.getElementById('canvas');
Function tile
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.tile = function () {
if (this.modal) {
var mtop = topmargin;
var left = 0;
var width = w - (w / 20);
Function Ajax
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function Ajax(method, uri, body, fn, err) {
if (typeof (XMLHttpRequest) == 'undefined') {
return false;
}
if (r2.asyncMode == 'fake') {
- 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 highlight_instruction
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function highlight_instruction(line, instruction) {
if (line === undefined) return 'undefined';
if (instruction === undefined) instruction = true;
var ret = escapeHTML(line);
- 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"