Showing 39 of 187 total issues
File methods.js
has 442 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Meteor } from "meteor/meteor";
import { ValidatedMethod } from "meteor/mdg:validated-method";
import { SimpleSchema } from "meteor/aldeed:simple-schema";
import { Jobs } from "meteor/msavin:sjobs";
import { Roles } from "meteor/alanning:roles";
File methods.js
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Meteor } from "meteor/meteor";
import { ValidatedMethod } from "meteor/mdg:validated-method";
import { SimpleSchema } from "meteor/aldeed:simple-schema";
import { Roles } from "meteor/alanning:roles";
import { Jobs } from "meteor/msavin:sjobs";
Function up
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
up() {
// Announcements
// - Does not exist on the database currently. NOOP.
// Courses
Function run
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({
queueId,
studentEmails,
question,
notifications,
Function submit #js-modal-join-queue-form
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
"submit #js-modal-join-queue-form"(event, templateInstance) {
event.preventDefault();
let errors = false;
let data = {
File modal-join-queue.js
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Meteor } from "meteor/meteor";
import { Template } from "meteor/templating";
import { ReactiveArray } from "meteor/manuel:reactivearray";
import { ReactiveDict } from "meteor/reactive-dict";
import { SimpleSchema } from "meteor/aldeed:simple-schema";
Function run
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
run({
queueId,
studentEmails,
question,
notifications,
- 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 onRendered
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Template.Queue.onRendered(function onRendered() {
WebNotifications.requestPermission();
this.autorun(() => {
if (this.subscriptionsReady()) {
const queue = this.getQueue();
Function submit #js-modal-join-queue-form
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
"submit #js-modal-join-queue-form"(event, templateInstance) {
event.preventDefault();
let errors = false;
let data = {
- 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 run
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({ queueId }) {
const queue = Queues.findOne(queueId);
if (!queue) {
throw new Meteor.Error(
"queues.doesNotExist",
Function run
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({ queueId, name, locationId, scheduledEndTime }) {
const queue = Queues.findOne(queueId);
if (!queue || queue.status === "ended") {
throw new Meteor.Error(
"queues.doesNotExist"`No queue exists with id ${queueId}`
Function run
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({ ticketId }) {
const ticket = Tickets.findOne(ticketId);
if (!ticket || ticket.status === "deleted") {
throw new Meteor.Error(
"tickets.doesNotExist"`No ticket exists with id ${ticketId}`
Function onRendered
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Template.Queue.onRendered(function onRendered() {
WebNotifications.requestPermission();
this.autorun(() => {
if (this.subscriptionsReady()) {
const queue = this.getQueue();
- 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 run
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({ queueId }) {
const queue = Queues.findOne(queueId);
if (!queue || queue.status === "ended") {
throw new Meteor.Error(
"queues.doesNotExist"`No queue exists with id ${queueId}`
Function onCreated
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Template.ModalJoinQueue.onCreated(function onCreated() {
this.errors = new ReactiveDict();
this.studentEmails = new ReactiveArray([]);
this.addStudentEmail = (email, callback) => {
Function run
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({ ticketId }) {
const ticket = Tickets.findOne(ticketId);
if (!ticket || ticket.status === "deleted") {
throw new Meteor.Error(
"tickets.doesNotExist"`No ticket exists with id ${ticketId}`
Function run
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({ ticketId }) {
const ticket = Tickets.findOne(ticketId);
if (!ticket || ticket.status === "deleted") {
throw new Meteor.Error(
"tickets.doesNotExist"`No ticket exists with id ${ticketId}`
Function run
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({ ticketId }) {
const ticket = Tickets.findOne(ticketId);
if (!ticket || ticket.status === "deleted") {
throw new Meteor.Error(
"tickets.doesNotExist"`No ticket exists with id ${ticketId}`
Function run
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({ ticketId }) {
const ticket = Tickets.findOne(ticketId);
if (!ticket) {
throw new Meteor.Error(
"tickets.doesNotExist"`No ticket exists with id ${ticketId}`
Function run
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
run({ queueId }) {
const queue = Queues.findOne(queueId);
if (!queue || queue.status === "ended") {
throw new Meteor.Error(
"queues.doesNotExist",