Showing 243 of 2,691 total issues
Function insertData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
TypesPanel.prototype.insertData = function(k, v, array) {
if (typeof array === 'undefined') { array = this.data; };
var kt = k[0].trim();
if (k.length == 1) {
Function createExportDialog
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
createExportDialog(label, output, save) {
var dialog = document.createElement('dialog');
dialog.className = 'mdl-dialog';
if (!dialog.showModal) {
Function drawChunk
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawChunk(chunk, domAnchor) {
domAnchor.innerHTML = chunk.data;
// TODO Dirty workaround, see with worker usage
const seekableElements = domAnchor.getElementsByClassName('r2seek');
for (const el of seekableElements) {
Function update_minimap
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update_minimap() {
if (r2ui._dis.minimap && $('#canvas svg').length) {
var minimap_width = 200;
var minimap_height = 200;
var svg_width = $('#canvas svg')[0].getBBox().width;
Function handle_hex_double_click
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function handle_hex_double_click(inEvent) {
// handle offset seek
if ($(inEvent.target).hasClass('hexaddr')) {
var address = get_address_from_class(inEvent.target, 'hexaddr');
console.log(address);
- 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 selectRange
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function selectRange() {
$('span.dword').removeClass('autohighlighti');
if (r2ui._hex.dragEnd + 1 < r2ui._hex.dragStart) { // reverse select
var cells = $('span.dword').slice(r2ui._hex.dragEnd, r2ui._hex.dragStart + 1).addClass('autohighlighti');
for (var i in cells) {
- 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 keyHandler
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
keyHandler(e) {
if (e.keyCode === ACKeys.UP || e.keyCode === ACKeys.DOWN) {
return this.keyMovement_(e.keyCode);
}
- 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 dragElement
has 35 lines of code (exceeds 25 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;
Function statusNext
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function statusNext() {
var statusbar = document.getElementById('statusbar');
var container = document.getElementById('container');
switch (statusMode) {
case Mode.LINE:
Function drawControls
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawControls(dom) {
dom.innerHTML = '';
const more = Inputs.iconButton('list', 'Others representations');
more.id = 'disasm_more';
Function BBGraph
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var BBGraph = function() {
this.vertices = {};
this.edges = [];
this.elements = [];
this.links = [];
Function onkeyup
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_('body').onkeyup = function (e) {
if (t.modal) {
return;
}
var key = String.fromCharCode(e.keyCode);
Function getState
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
SaveStateHandler.prototype.getState = function() {
var getOpenNodeIds, getSelectedNodeIds;
getOpenNodeIds = (function(_this) {
return function() {
var open_nodes;
Function startHandler
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function startHandler(event)
{
var $elem = jQuery(this);
// Merge the defaults and any user defined settings.
Function newHelpFrame
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function newHelpFrame () {
var n = t.defname('help');
function newthing (name) {
// TODO: disas_code id
setTimeout(function () {
Function statusConsole
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function statusConsole() {
var statusbar = document.getElementById('statusbar');
var container = document.getElementById('container');
if (statusTab === Tab.CONSOLE) {
if (statusMode !== Mode.LINE) {
Function _getDataUrlInfo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
JqTreeWidget.prototype._getDataUrlInfo = function(node) {
var data_url, getUrlFromString;
data_url = this.options.dataUrl || this.element.data('url');
getUrlFromString = (function(_this) {
return function() {
Function getPanel
has 32 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 configureWorker_
has 32 lines of code (exceeds 25 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') {
Function statusConsole
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function statusConsole() {
var statusbar = document.getElementById('statusbar');
var container = document.getElementById('container');
if (statusTab === Tab.CONSOLE) {
if (statusMode !== Mode.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"