signmeup/signmeup

View on GitHub

Showing 39 of 187 total issues

Function run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  run({ queueId, name, userAgent, secret }) {
    const queue = Queues.findOne(queueId);
    if (!queue) {
      throw new Meteor.Error(
        "queues.doesNotExist",
Severity: Minor
Found in imports/api/queues/methods.js - About 1 hr to fix

    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}`
    Severity: Minor
    Found in imports/api/tickets/methods.js - About 1 hr to fix

      Function sendTextNotification has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        static sendTextNotification(ticket) {
          const queue = Queues.findOne(ticket.queueId);
          if (!queue) {
            throw new Meteor.Error(
              "queues.doesNotExist",
      Severity: Minor
      Found in imports/lib/both/notifications.js - About 1 hr to fix

        Function up has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          up() {
            const fishbowlWithLocation = Locations.findOne({
              name: "CIT 271 (Fishbowl)"
            });
            const fishbowl = Locations.findOne({ name: "Fishbowl" });
        Severity: Minor
        Found in imports/startup/server/migrations/3-merge-duplicate-locations.js - About 1 hr to fix

          Function run has 33 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}`
          Severity: Minor
          Found in imports/api/queues/methods.js - About 1 hr to fix

            Function run has 31 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}`
            Severity: Minor
            Found in imports/api/queues/methods.js - About 1 hr to fix

              Function run has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                run({ email, role, courseId }) {
                  // If specified, check if course exists
                  const course = Courses.findOne(courseId);
                  if (_.contains(["hta", "ta"], role) && !course) {
                    throw new Meteor.Error(
              Severity: Minor
              Found in imports/api/users/methods.js - About 1 hr to fix

                Function availableSettings has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  availableSettings() {
                    if (!Meteor.user()) return [];
                
                    let settings = [
                      {
                Severity: Minor
                Found in imports/ui/pages/settings/settings.js - About 1 hr to fix

                  Function init has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function init() {
                    // Course
                    const testCourse = Courses.findOne({ name: "cs00" });
                    testCourseId = testCourse
                      ? testCourse._id
                  Severity: Minor
                  Found in imports/startup/server/fixtures.js - About 1 hr to fix

                    Function sendEmailNotification has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static sendEmailNotification(ticket) {
                        const queue = Queues.findOne(ticket.queueId);
                        if (!queue) {
                          throw new Meteor.Error(
                            "queues.doesNotExist",
                    Severity: Minor
                    Found in imports/lib/both/notifications.js - About 1 hr to fix

                      Function run has a Cognitive Complexity of 10 (exceeds 5 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}`
                      Severity: Minor
                      Found in imports/api/queues/methods.js - About 1 hr to fix

                      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 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        run({ queueId, sessionId }) {
                          const queue = Queues.findOne(queueId);
                          if (!queue) {
                            throw new Meteor.Error(
                              "queues.doesNotExist",
                      Severity: Minor
                      Found in imports/api/queues/methods.js - About 1 hr to fix

                        Function addStudentEmail has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          this.addStudentEmail = (email, callback) => {
                            email = email.toLowerCase(); // eslint-disable-line no-param-reassign
                            try {
                              new SimpleSchema({
                                email: {
                        Severity: Minor
                        Found in imports/ui/components/modals/modal-join-queue/modal-join-queue.js - About 1 hr to fix

                          Function run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                            run({ email, role, courseId }) {
                              // If specified, check if course exists
                              const course = Courses.findOne(courseId);
                              if (_.contains(["hta", "ta"], role) && !course) {
                                throw new Meteor.Error(
                          Severity: Minor
                          Found in imports/api/users/methods.js - About 45 mins to fix

                          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 onCreated has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Template.ModalJoinQueue.onCreated(function onCreated() {
                            this.errors = new ReactiveDict();
                          
                            this.studentEmails = new ReactiveArray([]);
                            this.addStudentEmail = (email, callback) => {
                          Severity: Minor
                          Found in imports/ui/components/modals/modal-join-queue/modal-join-queue.js - About 35 mins to fix

                          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 sendTextNotification has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                            static sendTextNotification(ticket) {
                              const queue = Queues.findOne(ticket.queueId);
                              if (!queue) {
                                throw new Meteor.Error(
                                  "queues.doesNotExist",
                          Severity: Minor
                          Found in imports/lib/both/notifications.js - About 35 mins to fix

                          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 sendEmailNotification has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                            static sendEmailNotification(ticket) {
                              const queue = Queues.findOne(ticket.queueId);
                              if (!queue) {
                                throw new Meteor.Error(
                                  "queues.doesNotExist",
                          Severity: Minor
                          Found in imports/lib/both/notifications.js - About 35 mins to fix

                          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 a Cognitive Complexity of 6 (exceeds 5 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}`
                          Severity: Minor
                          Found in imports/api/tickets/methods.js - About 25 mins to fix

                          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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Template.SettingsCourses.onRendered(function onRendered() {
                            this.autorun(() => {
                              const courseId = FlowRouter.getQueryParam("course");
                              if (!courseId && Meteor.user()) {
                                const courses = Meteor.user()
                          Severity: Minor
                          Found in imports/ui/components/settings-courses/settings-courses.js - About 25 mins to fix

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language