File phd.js
has 504 lines of code (exceeds 250 allowed). Consider refactoring. Open
const PHASE_ONE_ID = 1;
const PHASE_TWO_ID = 2;
var TIME_LIMIT_IN_MINUTES = 7;
var INTERVAL_IN_SECONDS_OF_HOW_OFTEN_TO_SHOW_OTHER_STUDENT_ACTIONS = 60; // one minute
var TIMEOUT_FOR_OTHER_PARTICIPANTS = 15 * 1000;
Function generate_box
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generate_box(span) {
var is_quota = span.className.match(/quota/i) != null
? true
: false;
if (is_quota && window.__show_quota_items) {
Function show_instructions
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.show_instructions = function() {
var timer_started = false;
$(".round").html("Round " + window.round_number);
reset_essay_links();
$(".round").html("Round " + window.round_number);
Function onShow
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
onShow: function(dialog) {
var modal = this;
$(".participant").show();
//accept enter
$(".participant input").keyup(function(event) {
Function finished_modal
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.finished_modal = function finished_modal() {
// basically 'callLater' something about these dialogs
setTimeout(function() {
$(".finished").modal({
close: false,
Function state
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
input.state = function() {
/*
Given a span like:
<span class='correctme' rel='correct string'>original string</span>
Function show_other_student_actions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.show_other_student_actions = function() {
// stops the timer and shows what other students are up to
// basically overlays a model dialog and we work from there
window.stop_timer();
// make sure whatever is open is now closed
Function score_card_modal
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.score_card_modal = function score_card_modal() {
// basically 'callLater' something about these dialogs
setTimeout(function() {
$(".score_card").modal({
close: false,
Function start_timer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.start_timer = function() {
window.stop_timer();
timer = setInterval(function() {
var minutes_to_render =
TIME_LIMIT_IN_MINUTES - parseInt(seconds / 60) - 1;
Function quit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.quit = function(kwargs) {
// make sure whatever is open is now closed
$.modal.close();
if (kwargs && kwargs.timeout) {
//MAKE IT SO WHEN IT TIMES OUT IT CHECKS WHAT ROUND IT IS ON AND DOES THE RIghT ThinG
Identical blocks of code found in 2 locations. Consider refactoring. Open
{
user_id: window.user.id,
round_number: window.round_number,
round_time: window.elapsed_time_in_seconds,
completed_in_time: window.completed_in_time,
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
{
user_id: window.user.id,
round_number: window.round_number,
round_time: window.elapsed_time_in_seconds,
completed_in_time: window.completed_in_time,
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!timer_started) {
window.start_timer();
timer_started = true;
$(".content").show();
// click on first essay
- 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 54.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!timer_started) {
window.start_timer();
timer_started = true;
$(".content").show();
// click on first essay
- 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 54.
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