Showing 243 of 2,691 total issues
Function initRuler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
initRuler() {
var context = {};
var _this = this;
this.rulerProp = {
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ProjectsPanel.prototype.render = function() {
$('#projects_tab').html('<div><div style="color: white;">Open Project:</div><div id="projects" style="color:rgb(127,127,127);"></div><div id="button"><br/><input id="submit" type="submit" value="Save Project" /></div></div>');
r2.cmdj('Plj', function(projects) {
var data = [];
for (var i in projects) {
Function open
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
FolderElement.prototype.open = function(on_finished, slide) {
var $button, doOpen;
if (slide == null) {
slide = true;
}
Function load_colors
has 28 lines of code (exceeds 25 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]) + ')';
Function go
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
go(where) {
var goNext = (where === NavigatorDirection.AFTER);
var dir = (goNext) ? 'next' : 'prev';
var howMany = this.gap;
Function on_hex_scroll
has a Cognitive Complexity of 10 (exceeds 5 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();
- 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 goToAddress
has a Cognitive Complexity of 10 (exceeds 5 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
- 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 get
has a Cognitive Complexity of 10 (exceeds 5 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 &&
- 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 10 (exceeds 5 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) {
- 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 addLongListDialog
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
addLongListDialog(list) {
var _this = this;
var dialog = document.createElement('dialog');
dialog.className = 'mdl-dialog';
- 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_history
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function render_history() {
var html = '<div>';
for (var i in r2ui.history) {
if (i > r2ui.history_idx - 8 && i < r2ui.history_idx + 3) {
var flag = r2.get_flag_names(r2ui.history[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 handleInputHexChange
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function handleInputHexChange() {
if (r2ui._hex.renaming !== null && r2ui._hex.rbox.value.length > 0) {
var value = r2ui._hex.rbox.value;
value = value.match(/^[0-9a-f]{0,4}$/gi);
if (value === null) {
- 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 configureWorker_
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
configureWorker_() {
var _this = this;
this.providerWorker.onmessage = function(e) {
var item;
for (var i = 0 ; i < _this.items.length ; 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 update_flags
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
r2.update_flags = function() {
r2.cmd('fs *;fj|', function(x) {
var fs = JSON.parse(x);
if (fs !== undefined && fs !== null) {
- 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 getSlot
has a Cognitive Complexity of 10 (exceeds 5 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];
}
- 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 build
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
build() {
this.card = document.createElement('div');
this.card.className = 'demo-options mdl-card mdl-color--teal-300 mdl-shadow--2dp mdl-cell mdl-cell--4-col mdl-cell--3-col-tablet mdl-cell--12-col-desktop';
const title = document.createElement('div');
Function create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function() {
r2.load_settings();
this.inherited(arguments);
var data = [
{ name: 'Disassembler', active: true },
Function collectHexpair
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var collectHexpair = (target) => {
if (target.busy) {
return; // Event has been already triggered elsewhere
}
// Don't need to set to false, in each case we remove the node
Function getPanel
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPanel() {
var c = document.createElement('div');
if (this.inColor) {
c.style.backgroundColor = '#202020';
}
Function seek
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
seek: function(addr, scroll) {
var error = false;
if (this.display === 'graph') {
this.$.minimap.show();
$('#center_panel').html('');