Showing 34 of 138 total issues
File circuits-show.js
has 766 lines of code (exceeds 250 allowed). Consider refactoring. Open
import './circuits-show.html';
import { Template } from 'meteor/peerlibrary:blaze-components';
import { Mongo } from 'meteor/mongo';
import { ReactiveDict } from 'meteor/reactive-dict';
Function circuitShowOnCreated
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
Template.Circuits_show.onCreated(function circuitShowOnCreated() {
Session.setDefault('component2add', false);
this.state = new ReactiveDict();
this.state.setDefault({
- 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 circuitShowOnCreated
has 211 lines of code (exceeds 25 allowed). Consider refactoring. Open
Template.Circuits_show.onCreated(function circuitShowOnCreated() {
Session.setDefault('component2add', false);
this.state = new ReactiveDict();
this.state.setDefault({
Function newNetPathPoint
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
export const newNetPathPoint = (d, T) => { // ['a-x', 'a-l', 'l', 'l-a', 'a-y']
const p = d ? getLastPointFromPathD(d) : {x:0, y:0};
let str = '';
let dl = 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
`` has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Template.Circuits_show.events({
// COMMON --------------------------------------------------------------------
'click .js-view-circuit' (event, instance) {
event.preventDefault();
instance.state.set('acting', 'viewing');
Function circuitsInfoOnCreated
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Template.Circuit_info.onCreated(function circuitsInfoOnCreated() {
this.getCircuitId = () => FlowRouter.getParam('_id');
this.state = new ReactiveDict();
this.state.setDefault({
Function symbolsEditorOnCreated
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Template.Symbols_editor.onCreated(function symbolsEditorOnCreated() {
this.autorun(() => {
new SimpleSchema({
symbol: { type: Function },
symbolReady: { type: Boolean },
Function processRelativeTime
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's':
return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
`` has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Template.Circuits_show.helpers({
mouse: () => Template.instance().state.get('mouse'),
zoom: () => Template.instance().state.get('zoom'),
pan: () => Template.instance().state.get('pan'),
viewZoom() {
Function click .wiring .js-wire
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click .wiring .js-wire'(event, instance) {
const name = instance.$(event.currentTarget).attr('name');
const T = instance.state.get('mouse');
const p = instance.snapToGrid(T);
// console.log( `CLICK on WIRE ${name}` );
Function click .wiring .js-active-pin
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click .wiring .js-active-pin' (event, instance) {
const $pin = instance.$( '.js-active-pin' );
const p = {
id: $pin.attr('id'),
x: $pin.attr('cx'),
Function newNetPathPoint
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.newNetPathPoint = (T) => { // ['a-x', 'a-l', 'l', 'l-a', 'a-y']
const d = this.$('.js-active-wire').data().wire.d;
const p = d ? getLastPointFromPathD(d) : {x:0, y:0};
// let p = {x:0, y:0};
// if(d) {
Function saveSetting
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.saveSetting = () => {
const cid = this.getCircuitId();
switch (this.state.get('editing')) {
case 'circuitName': {
const name = this.$('input[name=circuitName]').val();
Function newNetPathPoint
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const newNetPathPoint = (d, T) => { // ['a-x', 'a-l', 'l', 'l-a', 'a-y']
const p = d ? getLastPointFromPathD(d) : {x:0, y:0};
let str = '';
let dl = 0;
Function circuitsInfoOnCreated
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Template.Circuit_info.onCreated(function circuitsInfoOnCreated() {
this.getCircuitId = () => FlowRouter.getParam('_id');
this.state = new ReactiveDict();
this.state.setDefault({
- 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 symbolsEditorOnCreated
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Template.Symbols_editor.onCreated(function symbolsEditorOnCreated() {
this.autorun(() => {
new SimpleSchema({
symbol: { type: Function },
symbolReady: { type: Boolean },
- 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 click .wiring .js-active-pin
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
'click .wiring .js-active-pin' (event, instance) {
const $pin = instance.$( '.js-active-pin' );
const p = {
id: $pin.attr('id'),
x: $pin.attr('cx'),
- 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 getEventPoint
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.getEventPoint = (event, mode) => {
const T = { x:0, y:0 };
if (event.type.indexOf('mouse') > -1) {
//event.type === 'mousemove'
if(mode === 'svg') {
Function getLastPointFromPathD
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getLastPointFromPathD = (d) => {
const p = {x:0, y:0};
Snap.parsePathString(d).map((s) => {
switch (s[0]) {
case 'M':
Function circuitsGraphOnCreated
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Template.Circuit_graph.onCreated(function circuitsGraphOnCreated() {
this.getCircuitId = () => FlowRouter.getParam('_id');
this.autorun(() => {
this.subscribe('elements.inCircuit', this.getCircuitId());