vegantech/sims

View on GitHub

Showing 210 of 433 total issues

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

function _getFormInputs( inputPattern ) {
    var inputs = new Array();
    for( var i = 0; i < document.forms.length; i++ ) {
        for( var j = 0; j < document.forms[i].elements.length; j++ ) {
            if( document.forms[i].elements[j].type.match( inputPattern )) {
Severity: Major
Found in app/assets/javascripts/spellerpages/spellChecker.js and 1 other location - About 6 hrs to fix
public/speller/spellChecker.js on lines 438..448

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 158.

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

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

function _getFormInputs( inputPattern ) {
    var inputs = new Array();
    for( var i = 0; i < document.forms.length; i++ ) {
        for( var j = 0; j < document.forms[i].elements.length; j++ ) {
            if( document.forms[i].elements[j].type.match( inputPattern )) {
Severity: Major
Found in public/speller/spellChecker.js and 1 other location - About 6 hrs to fix
app/assets/javascripts/spellerpages/spellChecker.js on lines 448..458

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 158.

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 6 locations. Consider refactoring.
Open

describe District::UsersController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "district/users", :action => "index").should == "/district/users"
    end
Severity: Major
Found in pending-spec/routing-pending/district/users_routing_spec.rb and 5 other locations - About 6 hrs to fix
pending-spec/routing-pending/district/flag_categories_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/schools_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/students_routing_spec.rb on lines 3..58
pending-spec/routing-pending/intervention_builder/goals_routing_spec.rb on lines 3..56
pending-spec/routing-pending/intervention_builder/probes_routing_spec.rb on lines 3..56

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 200.

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 6 locations. Consider refactoring.
Open

describe InterventionBuilder::GoalsController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "intervention_builder/goals", :action => "index").should == "/intervention_builder/goals"
    end
pending-spec/routing-pending/district/flag_categories_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/schools_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/students_routing_spec.rb on lines 3..58
pending-spec/routing-pending/district/users_routing_spec.rb on lines 3..56
pending-spec/routing-pending/intervention_builder/probes_routing_spec.rb on lines 3..56

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 200.

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 6 locations. Consider refactoring.
Open

describe District::StudentsController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "district/students", :action => "index").should == "/district/students"
    end
pending-spec/routing-pending/district/flag_categories_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/schools_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/users_routing_spec.rb on lines 3..56
pending-spec/routing-pending/intervention_builder/goals_routing_spec.rb on lines 3..56
pending-spec/routing-pending/intervention_builder/probes_routing_spec.rb on lines 3..56

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 200.

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 6 locations. Consider refactoring.
Open

describe InterventionBuilder::ProbesController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "intervention_builder/probes", :action => "index").should == "/intervention_builder/probes"
    end
pending-spec/routing-pending/district/flag_categories_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/schools_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/students_routing_spec.rb on lines 3..58
pending-spec/routing-pending/district/users_routing_spec.rb on lines 3..56
pending-spec/routing-pending/intervention_builder/goals_routing_spec.rb on lines 3..56

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 200.

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 6 locations. Consider refactoring.
Open

describe District::SchoolsController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "district/schools", :action => "index").should == "/district/schools"
    end
pending-spec/routing-pending/district/flag_categories_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/students_routing_spec.rb on lines 3..58
pending-spec/routing-pending/district/users_routing_spec.rb on lines 3..56
pending-spec/routing-pending/intervention_builder/goals_routing_spec.rb on lines 3..56
pending-spec/routing-pending/intervention_builder/probes_routing_spec.rb on lines 3..56

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 200.

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 6 locations. Consider refactoring.
Open

describe District::FlagCategoriesController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "district/flag_categories", :action => "index").should == "/district/flag_categories"
    end
pending-spec/routing-pending/district/schools_routing_spec.rb on lines 3..56
pending-spec/routing-pending/district/students_routing_spec.rb on lines 3..58
pending-spec/routing-pending/district/users_routing_spec.rb on lines 3..56
pending-spec/routing-pending/intervention_builder/goals_routing_spec.rb on lines 3..56
pending-spec/routing-pending/intervention_builder/probes_routing_spec.rb on lines 3..56

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 200.

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 7 locations. Consider refactoring.
Open

describe CustomFlagsController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "custom_flags", :action => "index").should == "/custom_flags"
    end
Severity: Major
Found in pending-spec/routing-pending/custom_flags_routing_spec.rb and 6 other locations - About 6 hrs to fix
pending-spec/routing-pending/checklists_routing_spec.rb on lines 3..56
pending-spec/routing-pending/groups_routing_spec.rb on lines 3..56
pending-spec/routing-pending/interventions_routing_spec.rb on lines 3..56
pending-spec/routing-pending/news_items_routing_spec.rb on lines 3..56
pending-spec/routing-pending/principal_overrides_routing_spec.rb on lines 3..56
pending-spec/routing-pending/quicklist_items_routing_spec.rb on lines 3..56

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 199.

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 7 locations. Consider refactoring.
Open

describe ChecklistsController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "checklists", :action => "index").should == "/checklists"
    end
Severity: Major
Found in pending-spec/routing-pending/checklists_routing_spec.rb and 6 other locations - About 6 hrs to fix
pending-spec/routing-pending/custom_flags_routing_spec.rb on lines 3..56
pending-spec/routing-pending/groups_routing_spec.rb on lines 3..56
pending-spec/routing-pending/interventions_routing_spec.rb on lines 3..56
pending-spec/routing-pending/news_items_routing_spec.rb on lines 3..56
pending-spec/routing-pending/principal_overrides_routing_spec.rb on lines 3..56
pending-spec/routing-pending/quicklist_items_routing_spec.rb on lines 3..56

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 199.

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 7 locations. Consider refactoring.
Open

describe InterventionsController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "interventions", :action => "index").should == "/interventions"
    end
Severity: Major
Found in pending-spec/routing-pending/interventions_routing_spec.rb and 6 other locations - About 6 hrs to fix
pending-spec/routing-pending/checklists_routing_spec.rb on lines 3..56
pending-spec/routing-pending/custom_flags_routing_spec.rb on lines 3..56
pending-spec/routing-pending/groups_routing_spec.rb on lines 3..56
pending-spec/routing-pending/news_items_routing_spec.rb on lines 3..56
pending-spec/routing-pending/principal_overrides_routing_spec.rb on lines 3..56
pending-spec/routing-pending/quicklist_items_routing_spec.rb on lines 3..56

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 199.

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 7 locations. Consider refactoring.
Open

describe GroupsController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "groups", :action => "index").should == "/groups"
    end
Severity: Major
Found in pending-spec/routing-pending/groups_routing_spec.rb and 6 other locations - About 6 hrs to fix
pending-spec/routing-pending/checklists_routing_spec.rb on lines 3..56
pending-spec/routing-pending/custom_flags_routing_spec.rb on lines 3..56
pending-spec/routing-pending/interventions_routing_spec.rb on lines 3..56
pending-spec/routing-pending/news_items_routing_spec.rb on lines 3..56
pending-spec/routing-pending/principal_overrides_routing_spec.rb on lines 3..56
pending-spec/routing-pending/quicklist_items_routing_spec.rb on lines 3..56

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 199.

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 7 locations. Consider refactoring.
Open

describe PrincipalOverridesController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "principal_overrides", :action => "index").should == "/principal_overrides"
    end
pending-spec/routing-pending/checklists_routing_spec.rb on lines 3..56
pending-spec/routing-pending/custom_flags_routing_spec.rb on lines 3..56
pending-spec/routing-pending/groups_routing_spec.rb on lines 3..56
pending-spec/routing-pending/interventions_routing_spec.rb on lines 3..56
pending-spec/routing-pending/news_items_routing_spec.rb on lines 3..56
pending-spec/routing-pending/quicklist_items_routing_spec.rb on lines 3..56

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 199.

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 7 locations. Consider refactoring.
Open

describe QuicklistItemsController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "quicklist_items", :action => "index").should == "/quicklist_items"
    end
pending-spec/routing-pending/checklists_routing_spec.rb on lines 3..56
pending-spec/routing-pending/custom_flags_routing_spec.rb on lines 3..56
pending-spec/routing-pending/groups_routing_spec.rb on lines 3..56
pending-spec/routing-pending/interventions_routing_spec.rb on lines 3..56
pending-spec/routing-pending/news_items_routing_spec.rb on lines 3..56
pending-spec/routing-pending/principal_overrides_routing_spec.rb on lines 3..56

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 199.

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 7 locations. Consider refactoring.
Open

describe NewsItemsController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "news_items", :action => "index").should == "/news_items"
    end
Severity: Major
Found in pending-spec/routing-pending/news_items_routing_spec.rb and 6 other locations - About 6 hrs to fix
pending-spec/routing-pending/checklists_routing_spec.rb on lines 3..56
pending-spec/routing-pending/custom_flags_routing_spec.rb on lines 3..56
pending-spec/routing-pending/groups_routing_spec.rb on lines 3..56
pending-spec/routing-pending/interventions_routing_spec.rb on lines 3..56
pending-spec/routing-pending/principal_overrides_routing_spec.rb on lines 3..56
pending-spec/routing-pending/quicklist_items_routing_spec.rb on lines 3..56

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 199.

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 (v=="above") { this.setTop(refTop-height+this.offsetTop); }
            else if (v=="top") { this.setTop(refTop+this.offsetTop); }
            else if (v=="center") { this.setTop(refTop+(refHeight/2)-(height/2)+this.offsetTop); }
            else if (v=="bottom") { this.setTop(refTop+refHeight-height+this.offsetTop); }
            else if (v=="below") { this.setTop(refTop+refHeight+this.offsetTop); }
Severity: Major
Found in app/assets/javascripts/popup.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/popup.js on lines 1054..1058

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 152.

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 (h=="adjacent-left") { this.setLeft(refLeft-width+this.offsetLeft); }
            else if (h=="left") { this.setLeft(refLeft+this.offsetLeft); }
            else if (h=="center") { this.setLeft(refLeft+(refWidth/2)-(width/2)+this.offsetLeft); }
            else if (h=="right") { this.setLeft(refLeft+refWidth-width+this.offsetLeft); }
            else if (h=="adjacent-right") { this.setLeft(refLeft+refWidth+this.offsetLeft); }
Severity: Major
Found in app/assets/javascripts/popup.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/popup.js on lines 1047..1051

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 152.

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(inp.className.search(regExp3) != -1) {
                                        var tmp = inp.className.match(regExp3)[0].replace(/highlight-days-/, '');
                                        options.highlightDays = [0,0,0,0,0,0,0];
                                        for(var j = 0; j < tmp.length; j++) {
                                                options.highlightDays[tmp.charAt(j) - 1] = 1;
Severity: Major
Found in app/assets/javascripts/datepicker.js and 1 other location - About 4 hrs to fix
app/assets/javascripts/datepicker.js on lines 1388..1394

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 133.

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(inp.className.search(regExp1) != -1) {
                                        var tmp = inp.className.match(regExp1)[0].replace(/disable-days-/, '');
                                        options.disableDays = [0,0,0,0,0,0,0];
                                        for(var j = 0; j < tmp.length; j++) {
                                                options.disableDays[tmp.charAt(j) - 1] = 1;
Severity: Major
Found in app/assets/javascripts/datepicker.js and 1 other location - About 4 hrs to fix
app/assets/javascripts/datepicker.js on lines 1379..1385

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 133.

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

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

function printForHtml( n ) {
    var htmlstr = n;
    if( htmlstr.length == 1 ) {
        // do simple case statement if it's just one character
        switch ( n ) {
Severity: Major
Found in public/speller/wordWindow.js and 1 other location - About 4 hrs to fix
app/assets/javascripts/spellerpages/wordWindow.js on lines 218..240

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 131.

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

Severity
Category
Status
Source
Language