Showing 203 of 447 total issues
Function updatePortsAttrs
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updatePortsAttrs: function (/*eventName*/) {
'use strict';
if (this._portSelectors) {
var newAttrs = _.omit(this.get('attrs'), this._portSelectors);
Function generateCode
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generateCode(cmd) {
return new Promise(function (resolve) {
project.snapshot();
project.update();
var opt = {
Function _addBlockFile
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _addBlockFile(self, orig, name, data, notify) {
function _importBlock() {
self.addBlock(block);
if (notify) {
alertify.success(
Function confirm
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.confirm = function (opts) {
/* Options
body string or DOM element
closable boolean
closableByDimmer boolean
Function revertCommand
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
revertCommand: function (command) {
'use strict';
this.stopListening();
var batchCommand;
Function lpfCompiler
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function lpfCompiler(project) {
var i,
block,
pin,
value,
Function updateBox
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateBox: function (element) {
'use strict';
var bbox = element.getBBox();
var state = this.options.state;
Function adjustSelection
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
adjustSelection: function (evt) {
'use strict';
var dx;
var dy;
Function ICEToolRun
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ICEToolRun(commands, startMessage, endMessage) {
return new Promise(function (resolve) {
var sourceCode = '';
if (!taskRunning) {
Function generate
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.generate = function (target, project, opt) {
var content = '';
var files = [];
switch (target) {
case 'verilog':
Consider simplifying this complex logical expression. Open
Open
if (
(source.id === cell.id &&
containsPort(source.port, size, cell.get('rightPorts'))) ||
(target.id === cell.id &&
containsPort(target.port, size, cell.get('leftPorts')) &&
Function router
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function router(vertices, opt) {
resolveOptions(opt);
/* jshint -W040 */
Function module
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function module(data) {
var code = '';
if (data && data.name && data.ports) {
// Header
code += '\nmodule ' + data.name;
Function alert
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.alert = function (opts) {
/* Options
body string or DOM element
closable boolean
closableByDimmer boolean
Function updateBox
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateBox: function () {
'use strict';
var bbox = this.model.getBBox();
var data = this.model.get('data');
Function appEnable
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.appEnable = function (value) {
paper.options.enabled = value;
var ael, i;
if (value) {
/* In the new javascript context of nwjs, angular can't change classes over the dom in this way,
Function applyCommand
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
applyCommand: function (command) {
'use strict';
this.stopListening();
var batchCommand;
- 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 applyCommand
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
applyCommand: function (command) {
'use strict';
this.stopListening();
var batchCommand;
Function fitContent
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.fitContent = function () {
if (!this.isEmpty()) {
// Target box
var margin = 40;
var menuFooterHeight = 93;
Function renderPorts
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderPorts: function () {
'use strict';
var $leftPorts = this.$('.leftPorts').empty();
var $rightPorts = this.$('.rightPorts').empty();