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');
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';
Function generateNewParticipants
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateNewParticipants () {
if (this.isFinalized) {
throw new Error('generateNewParticipants () must not be called on finalized minutes');
}
let changed = false;
Function updateParticipantPresent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async updateParticipantPresent(userid, isPresent) {
let index = -1;
if (this.participants) {
for (let i=0; i < this.participants.length; i++) {
if (this.participants[i].userId === userid) {
- 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 generateNewParticipants
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
generateNewParticipants () {
if (this.isFinalized) {
throw new Error('generateNewParticipants () must not be called on finalized minutes');
}
let changed = 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 save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
save (optimisticUICallback, serverCallback) {
console.log('Minutes.save()');
if (this.createdAt === undefined) {
this.createdAt = new Date();
}
- 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
TODO found Open
* TODO Reactive performance may be better if we only update one array element in DB
- Exclude checks