Showing 160 of 452 total issues
File minutesedit.js
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment/moment';
import { Template } from 'meteor/templating';
import { i18n } from 'meteor/universe:i18n';
import { Blaze } from 'meteor/blaze';
import { Session } from 'meteor/session';
File topicInfoItemList.js
has 537 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Topic } from '/imports/topic';
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
import { $ } from 'meteor/jquery';
Minutes
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
export class Minutes {
constructor(source) { // constructs obj from Mongo ID or Mongo document
if (! source)
throw new Meteor.Error('invalid-argument', 'Mongo ID or Mongo document required');
Function removeIsEditedMinute
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function removeIsEditedMinute(minuteId, ignoreLock) {
let minute = new Minutes(minuteId);
for (let topic of minute.topics) {
if (ignoreLock === true) {
topic.isEditedBy = 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
Topic
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
export class Topic {
/**
*
* @param parentElement {string|object} is either the id of the parent minute or parent meeting series
MeetingSeries
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
export class MeetingSeries {
constructor(source) { // constructs obj from Mongo ID or Mongo document
if (! source)
return;
File minutes.js
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Meteor } from 'meteor/meteor';
import { i18n } from 'meteor/universe:i18n';
import { Random } from 'meteor/random';
import { MinutesSchema } from './collections/minutes.schema';
import { MeetingSeries } from './meetingseries';
File topicElement.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Minutes } from '/imports/minutes';
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
import { ReactiveVar } from 'meteor/reactive-var';
`` has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Meteor.methods({
'e2e.debugLog'(message) {
console.log(message);
},
'e2e.resetMyApp'(skipUsersCreation) {
InfoItem
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
export class InfoItem {
constructor(parentTopic, source) {
if (!parentTopic || !source)
throw new Meteor.Error('It is not allowed to create a InfoItem without the parentTopicId and the source');
File topicInfoItemEdit.js
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment/moment';
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
Function createTestCases
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
static createTestCases() {
// to add tests simply push a new TestCase Object to the testCases property
// no topics in minute (F) (A)
QualityTestCase.testCases.push(new QualityTestCase('No topics in minute',
Function show.bs.modal #dlgAddInfoItem
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
'show.bs.modal #dlgAddInfoItem': function (evt, tmpl) {
// at this point we clear the view
let saveButton = $('#btnInfoItemSave');
let cancelButton = $('#btnInfoItemCancel');
saveButton.prop('disabled',false);
- 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 users.editProfile
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
'users.editProfile'(userId, eMail, longName) {
check(eMail, String);
check(longName, String);
if (! Meteor.userId()) {
throw new Meteor.Error('Cannot edit profile', 'User not logged in.');
- 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 documentgeneration.createAndStoreFile
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
'documentgeneration.createAndStoreFile'(minutesId) {
if (Meteor.isClient) {
return;
}
if (! Meteor.settings.public.docGeneration.enabled) {
Function show.bs.modal #dlgAddInfoItem
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
'show.bs.modal #dlgAddInfoItem': function (evt, tmpl) {
// at this point we clear the view
let saveButton = $('#btnInfoItemSave');
let cancelButton = $('#btnInfoItemCancel');
saveButton.prop('disabled',false);
Function workflow.addMinutes
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
'workflow.addMinutes'(doc, clientCallback) {
checkUserAvailableAndIsModeratorOf(doc.meetingSeries_id);
// It is not allowed to insert new minutes if the last minute was not finalized
check(doc.meetingSeries_id, String);
File meetingseries.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import { MeetingSeriesSchema } from './collections/meetingseries.schema';
import { MinutesFinder } from '/imports/services/minutesFinder';
import { Minutes } from './minutes';
Function preImportCheck
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
static preImportCheck (db, msID) {
return new Promise((resolve, reject) => {
const mapFile = msID + ExpImpUsers.MAPNAME_POSTFIX;
let usrMap = undefined;
try {
Function updateCheck
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
let updateCheck = function (forceReport) {
HTTP.get(url, {}, function (error, result) {
if (error || !result.data || !result.data.tag) {
// Swallow silently.
// If we can't check the version - we will not bother the admin...
- 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"