Showing 243 of 2,691 total issues
Function calc
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function calc (addr) {
if (addr) {
frame.offset = addr;
}
var off = frame.offset || '0';
Function handleKeyPress
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
handleKeyPress: function(inSender, inEvent) {
for (var key in Config.keys) {
if (key.substring(0, 2) == 'C-') {
if (inEvent.ctrlKey) {
var k = key.substring(2).charCodeAt(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 update_minimap
has a Cognitive Complexity of 14 (exceeds 5 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;
- 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 reposition_graph
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function reposition_graph() {
var bbs = r2ui.graph.getElements();
var blocks = r2ui.get_fcn_BBs(r2ui.current_fcn_offset);
var bb_offsets = Object.keys(blocks);
for (var i in bbs) {
- 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 iterate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
VisibleNodeIterator.prototype.iterate = function() {
var is_first_node, _iterateNode;
is_first_node = true;
_iterateNode = (function(_this) {
return function(node, next_node) {
Function on_scroll
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function on_scroll(event) {
// console.log($(event.target).scrollTop());
if (!r2ui._dis.scrolling) {
var enyo = $('#radareApp').length ? true : false;
var panel_disas = false;
Function populateFrom
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
populateFrom(offset) {
// From currentOffset
// I want at least 80% of 3 screens
// go up of 1 screen, take first in order
Function save
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
save: function() {
var use_new_view = this.$.use_new_view.active;
var show_offset = this.$.toggle_offset.active;
var arch = this.$.arch.selected.content;
var bits = this.$.bits.selected.content;
Function drawContent
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawContent(dom, callback) {
dom.innerHTML = '';
this.listContent = document.createElement('ul');
this.listContent.className = 'listContent';
Function highlight_instruction
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function highlight_instruction(line, instruction) {
if (line === undefined) return 'undefined';
if (instruction === undefined) instruction = true;
var ret = escapeHTML(line);
Function getPanel
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPanel() {
var c = document.createElement('div');
if (this.inColor) {
c.style.backgroundColor = '#202020';
}
Function createChart
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
createChart(name, title, color, value, onclick) {
const xmlns = "http://www.w3.org/2000/svg";
const svg = document.createElementNS(xmlns, 'svg');
svg.setAttribute('class', 'demo-chart mdl-cell mdl-cell--4-col mdl-cell--3-col-desktop');
svg.setAttribute('fill', 'currentColor');
Function del_frame
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.del_frame = function (name) {
var prev = undefined;
if (!name && this.curframe) {
name = this.curframe[0].name;
}
Function getChunk
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getChunk(howManyBytes, addr, nbCols) {
if (addr < 0) {
return {
offset: 0,
hex: [],
Function on_hex_scroll
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function on_hex_scroll() {
if (!r2ui._hex.scrolling) {
r2ui._hex.scrolling = true;
var scroll_offset = $('#center_panel').scrollTop();
var top_offset = $('.hexoffset').height() - $('#center_panel').height();
Function draw
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw() {
const nbVals = this.entropy.length;
if (nbVals < 1) {
return;
}
Function modalShell
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modalShell () {
var body = html.div('modal_body');
var out = html.div('modal_output', '', {
overflow: 'hidden',
backgroundColor: 'red',
Function colorizeFlag
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
colorizeFlag(reset) {
if (!this.showFlags) {
return;
}
Function do_rename
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
do_rename: function(element) {
if (this.renaming === null && this.selected !== null && this.selected.className.indexOf(' addr ') > -1) {
var address = get_address_from_class(this.selected);
this.renaming = this.selected;
this.renameOldValue = this.selected.innerHTML;
Function getFlags
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
getFlags(minSize, callback) {
var filter = function(flags) {
var filteredFlags = [];
for (var i = 0 ; i < flags.length ; i++) {
if (flags[i].size >= minSize) {