signmeup/signmeup

View on GitHub

Showing 185 of 187 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Template.CoursesGeneral.onRendered(() => {
  const tabId = FlowRouter.getQueryParam("tab");
  if (tabId) {
    $('a[href="#' + tabId + '"]').tab("show");
  }
imports/ui/components/settings-courses/courses-people/courses-people.js on lines 9..14

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 65.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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) => {
Severity: Minor
Found in imports/ui/components/modals/modal-join-queue/modal-join-queue.js - About 1 hr to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (moonlabWithLocation && moonlab) {
          Queues.update(
            {
              locationId: moonlab._id
            },
    imports/startup/server/migrations/3-merge-duplicate-locations.js on lines 20..33

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 64.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (fishbowlWithLocation && fishbowl) {
          Queues.update(
            {
              locationId: fishbowl._id
            },
    imports/startup/server/migrations/3-merge-duplicate-locations.js on lines 35..48

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 64.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

        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}`
        Severity: Minor
        Found in imports/api/tickets/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 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",
            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({ 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({ name, courseId, locationId, scheduledEndTime }) {
                    if (!Courses.findOne(courseId)) {
                      throw new Meteor.Error(
                        "courses.doesNotExist",
                        `No course exists with id ${courseId}`
                Severity: Minor
                Found in imports/api/queues/methods.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 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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                            if (!$.trim(preferredName)) {
                              Template.instance().errors.set(
                                "current-student",
                                "Please enter your name."
                              );
                      imports/ui/components/modals/modal-join-queue/modal-join-queue.js on lines 271..276

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 62.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          if (!$.trim(question)) {
                            Template.instance().errors.set("question", "Please enter a question.");
                            errors = true;
                          } else {
                            data.question = question;
                      imports/ui/components/modals/modal-join-queue/modal-join-queue.js on lines 248..256

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 62.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      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 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 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 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
                                Severity
                                Category
                                Status
                                Source
                                Language