Showing 203 of 447 total issues
Function appendDesign
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.appendDesign = function (design, dependencies) {
if (
design &&
dependencies &&
design.graph &&
Function loadBasicCode
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loadBasicCode(instance, disabled) {
var port;
var leftPorts = [];
var rightPorts = [];
var topPorts = [];
Function normalizeCodeError
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function normalizeCodeError(codeError, modules) {
var newCodeError;
// Find the module with the error
for (var i in modules) {
var module = modules[i];
Function editBasicCode
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function editBasicCode(cellView, callback) {
var graph = cellView.paper.model;
var block = cellView.model.attributes;
var blockInstance = {
id: block.id,
Function pasteFromClipboard
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.pasteFromClipboard = function (callback) {
nodeCP.paste(function (err, text) {
if (err) {
if (common.LINUX) {
// xclip installation message
Function about
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.about = function () {
alerts.alert({
icon: 'heart-o',
title: 'Icestudio, visual editor for Verilog designs',
body: $('#about')[0],
Function pasteAndCloneSelected
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.pasteAndCloneSelected = function () {
if (
document.activeElement.tagName === 'A' ||
document.activeElement.tagName === 'BODY'
) {
Function mapCodeModules
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mapCodeModules(code) {
var codelines = code.split('\n');
var match,
module = {
params: [],
Function run
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.run = function (id) {
let plug = this.getById(id);
if (plug === false) {
return false;
Function applyText
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
applyText: function () {
'use strict';
const data = this.model.get('data');
Function editBasicConstant
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function editBasicConstant(cellView) {
var block = cellView.model.attributes;
var formSpecs = [
{
type: 'text',
Function addDraggableCells
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.addDraggableCells = function (cells) {
this.addingDraggableBlock = true;
var menuHeight = $('#menu').height();
if (cells.length > 0) {
var firstCell = cells[0];
Function initialize
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initialize: function () {
'use strict';
_.bindAll(this, 'updateBox');
joint.dia.ElementView.prototype.initialize.apply(this, arguments);
Function initializePluginManager
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.initializePluginManager = function (callbackOnRun) {
if (typeof ICEpm !== 'undefined') {
console.log('ENV', common);
ICEpm.setEnvironment(common);
ICEpm.setPluginDir(common.DEFAULT_PLUGIN_DIR, function () {
Function plug
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.plug = function (
id,
userOptions,
callback_onconnect,
callback_onreceive
Function plug
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.plug = function (
id,
userOptions,
callback_onconnect,
callback_onreceive
Function mainIO
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mainIO(project) {
var input = [];
var output = [];
var inputUnnamed = 0;
var outputUnnamed = 0;
Function startCapture
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
function startCapture(button) {
if (server) {
UARTtoggleButtonState(button);
if (server.isUARTConnected()) {
- 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 updateBox
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateBox: function () {
'use strict';
var bbox = this.model.getBBox();
var state = this.model.get('state');
Function renderLabels
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderLabels: function () {
'use strict';
if (!this._V.labels) {
return this;