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");
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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) => {
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (moonlabWithLocation && moonlab) {
Queues.update(
{
locationId: moonlab._id
},
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (fishbowlWithLocation && fishbowl) {
Queues.update(
{
locationId: fishbowl._id
},
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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",
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",
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}`
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" });
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",
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!$.trim(preferredName)) {
Template.instance().errors.set(
"current-student",
"Please enter your name."
);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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;
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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}`
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}`
Function availableSettings
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
availableSettings() {
if (!Meteor.user()) return [];
let settings = [
{
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(
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