opengovernment/askthem

View on GitHub

Showing 70 of 154 total issues

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

  function addMetaTags(tagId, options) {
    this._createMetaTag = function(name, content) {
      var metaTag = jQuery("<meta>", {
        name: name,
        content: content
Severity: Major
Found in public/widgets/person/widget.js and 2 other locations - About 1 day to fix
public/widgets/address/widget.js on lines 54..91
public/widgets/widget-builder/widget.js on lines 54..91

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

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

  function addMetaTags(tagId, options) {
    this._createMetaTag = function(name, content) {
      var metaTag = jQuery("<meta>", {
        name: name,
        content: content
Severity: Major
Found in public/widgets/address/widget.js and 2 other locations - About 1 day to fix
public/widgets/person/widget.js on lines 54..91
public/widgets/widget-builder/widget.js on lines 54..91

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

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

  function addMetaTags(tagId, options) {
    this._createMetaTag = function(name, content) {
      var metaTag = jQuery("<meta>", {
        name: name,
        content: content
Severity: Major
Found in public/widgets/widget-builder/widget.js and 2 other locations - About 1 day to fix
public/widgets/address/widget.js on lines 54..91
public/widgets/person/widget.js on lines 54..91

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

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

  if (window.jQuery === undefined || window.jQuery.fn.jquery !== '2.1.1') {
    var script_tag = document.createElement('script');
    script_tag.setAttribute("type","text/javascript");
    script_tag.setAttribute("src",
                            "http://code.jquery.com/jquery-2.1.1.min.js");
Severity: Major
Found in public/widgets/zip/widget.js and 3 other locations - About 1 day to fix
public/widgets/address/widget.js on lines 15..35
public/widgets/person/widget.js on lines 15..35
public/widgets/widget-builder/widget.js on lines 15..35

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

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

  if (window.jQuery === undefined || window.jQuery.fn.jquery !== '2.1.3') {
    var script_tag = document.createElement('script');
    script_tag.setAttribute("type","text/javascript");
    script_tag.setAttribute("src",
                            "http://code.jquery.com/jquery-2.1.3.min.js");
Severity: Major
Found in public/widgets/address/widget.js and 3 other locations - About 1 day to fix
public/widgets/person/widget.js on lines 15..35
public/widgets/widget-builder/widget.js on lines 15..35
public/widgets/zip/widget.js on lines 15..35

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

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

  if (window.jQuery === undefined || window.jQuery.fn.jquery !== '2.1.3') {
    var script_tag = document.createElement('script');
    script_tag.setAttribute("type","text/javascript");
    script_tag.setAttribute("src",
                            "http://code.jquery.com/jquery-2.1.3.min.js");
Severity: Major
Found in public/widgets/person/widget.js and 3 other locations - About 1 day to fix
public/widgets/address/widget.js on lines 15..35
public/widgets/widget-builder/widget.js on lines 15..35
public/widgets/zip/widget.js on lines 15..35

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

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

  if (window.jQuery === undefined || window.jQuery.fn.jquery !== '2.1.3') {
    var script_tag = document.createElement('script');
    script_tag.setAttribute("type","text/javascript");
    script_tag.setAttribute("src",
                            "http://code.jquery.com/jquery-2.1.3.min.js");
Severity: Major
Found in public/widgets/widget-builder/widget.js and 3 other locations - About 1 day to fix
public/widgets/address/widget.js on lines 15..35
public/widgets/person/widget.js on lines 15..35
public/widgets/zip/widget.js on lines 15..35

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

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 (_ref = element.val(), __indexOf.call((function() {
            var _i, _len, _ref1, _results;
            _ref1 = options["in"];
            _results = [];
            for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
Severity: Major
Found in app/assets/javascripts/rails.validations.js and 1 other location - About 4 hrs to fix
app/assets/javascripts/rails.validations.js on lines 430..441

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

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 (_ref = element.val(), __indexOf.call((function() {
            var _i, _len, _ref1, _results;
            _ref1 = options["in"];
            _results = [];
            for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
Severity: Major
Found in app/assets/javascripts/rails.validations.js and 1 other location - About 4 hrs to fix
app/assets/javascripts/rails.validations.js on lines 399..410

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

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

  function appFromConcoction(tagId) {
    // TODO: make sure that tagId is valid for our needs
    var appConcoction;

    // in dev, loading fails in chrome with security issue, due to CORs no in pow
Severity: Major
Found in public/widgets/address/widget.js and 2 other locations - About 4 hrs to fix
public/widgets/person/widget.js on lines 94..119
public/widgets/widget-builder/widget.js on lines 94..119

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

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

  function appFromConcoction(tagId) {
    // TODO: make sure that tagId is valid for our needs
    var appConcoction;

    // in dev, loading fails in chrome with security issue, due to CORs no in pow
Severity: Major
Found in public/widgets/widget-builder/widget.js and 2 other locations - About 4 hrs to fix
public/widgets/address/widget.js on lines 94..119
public/widgets/person/widget.js on lines 94..119

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

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

  function appFromConcoction(tagId) {
    // TODO: make sure that tagId is valid for our needs
    var appConcoction;

    // in dev, loading fails in chrome with security issue, due to CORs no in pow
Severity: Major
Found in public/widgets/person/widget.js and 2 other locations - About 4 hrs to fix
public/widgets/address/widget.js on lines 94..119
public/widgets/widget-builder/widget.js on lines 94..119

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

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

          if(paramsDiv) {
            if (jQuery(paramsDiv).find('.partner-name').length > 0) partnerName = jQuery(paramsDiv).find('.partner-name').html();
          } else if (typeof jQuery(this).data('partner-name') !== "undefined") {
            partnerName = jQuery(this).data('partner-name');
          }
Severity: Major
Found in public/widgets/zip/widget.js and 1 other location - About 3 hrs to fix
public/widgets/address/widget.js on lines 189..193

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

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

          if(paramsDiv) {
            if (jQuery(paramsDiv).find('.partner-name').length > 0) partnerName = jQuery(paramsDiv).find('.partner-name').html();
          } else if (typeof jQuery(this).data('partner-name') !== "undefined") {
            partnerName = jQuery(this).data('partner-name');
          }
Severity: Major
Found in public/widgets/address/widget.js and 1 other location - About 3 hrs to fix
public/widgets/zip/widget.js on lines 121..125

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

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

          if(paramsDiv) {
            if (jQuery(paramsDiv).find('.partner-name').length > 0) partnerName = jQuery(paramsDiv).find('.partner-name').html();
          } else if (typeof jQuery(this).data('partner-name') !== "undefined") {
            partnerName = jQuery(this).data('partner-name');
          }
Severity: Major
Found in public/widgets/person/widget.js and 24 other locations - About 3 hrs to fix
public/widgets/address/widget.js on lines 198..202
public/widgets/address/widget.js on lines 206..210
public/widgets/address/widget.js on lines 214..218
public/widgets/address/widget.js on lines 222..226
public/widgets/address/widget.js on lines 230..234
public/widgets/person/widget.js on lines 197..201
public/widgets/person/widget.js on lines 205..209
public/widgets/person/widget.js on lines 212..216
public/widgets/person/widget.js on lines 219..223
public/widgets/person/widget.js on lines 226..230
public/widgets/person/widget.js on lines 233..237
public/widgets/person/widget.js on lines 240..244
public/widgets/person/widget.js on lines 247..251
public/widgets/person/widget.js on lines 254..258
public/widgets/person/widget.js on lines 262..266
public/widgets/person/widget.js on lines 270..274
public/widgets/person/widget.js on lines 278..282
public/widgets/widget-builder/widget.js on lines 190..194
public/widgets/widget-builder/widget.js on lines 198..202
public/widgets/zip/widget.js on lines 133..137
public/widgets/zip/widget.js on lines 144..148
public/widgets/zip/widget.js on lines 155..159
public/widgets/zip/widget.js on lines 166..170
public/widgets/zip/widget.js on lines 177..181

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

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

          if(paramsDiv) {
            if (jQuery(paramsDiv).find('.person-photo-url').length > 0) personPhotoUrl = jQuery(paramsDiv).find('.person-photo-url').html();
          } else if (typeof jQuery(this).data('person-photo-url') !== "undefined") {
            personPhotoUrl = jQuery(this).data('person-photo-url');
          }
Severity: Major
Found in public/widgets/person/widget.js and 24 other locations - About 3 hrs to fix
public/widgets/address/widget.js on lines 198..202
public/widgets/address/widget.js on lines 206..210
public/widgets/address/widget.js on lines 214..218
public/widgets/address/widget.js on lines 222..226
public/widgets/address/widget.js on lines 230..234
public/widgets/person/widget.js on lines 189..193
public/widgets/person/widget.js on lines 197..201
public/widgets/person/widget.js on lines 205..209
public/widgets/person/widget.js on lines 212..216
public/widgets/person/widget.js on lines 219..223
public/widgets/person/widget.js on lines 226..230
public/widgets/person/widget.js on lines 233..237
public/widgets/person/widget.js on lines 247..251
public/widgets/person/widget.js on lines 254..258
public/widgets/person/widget.js on lines 262..266
public/widgets/person/widget.js on lines 270..274
public/widgets/person/widget.js on lines 278..282
public/widgets/widget-builder/widget.js on lines 190..194
public/widgets/widget-builder/widget.js on lines 198..202
public/widgets/zip/widget.js on lines 133..137
public/widgets/zip/widget.js on lines 144..148
public/widgets/zip/widget.js on lines 155..159
public/widgets/zip/widget.js on lines 166..170
public/widgets/zip/widget.js on lines 177..181

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

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

          if(paramsDiv) {
            if (jQuery(paramsDiv).find('.intro-headline').length > 0) headline = jQuery(paramsDiv).find('.intro-headline').html();
          } else if (typeof jQuery(this).data('intro-headline') !== "undefined") {
            headline = jQuery(this).data('intro-headline');
          }
Severity: Major
Found in public/widgets/widget-builder/widget.js and 24 other locations - About 3 hrs to fix
public/widgets/address/widget.js on lines 198..202
public/widgets/address/widget.js on lines 206..210
public/widgets/address/widget.js on lines 214..218
public/widgets/address/widget.js on lines 222..226
public/widgets/address/widget.js on lines 230..234
public/widgets/person/widget.js on lines 189..193
public/widgets/person/widget.js on lines 197..201
public/widgets/person/widget.js on lines 205..209
public/widgets/person/widget.js on lines 212..216
public/widgets/person/widget.js on lines 219..223
public/widgets/person/widget.js on lines 226..230
public/widgets/person/widget.js on lines 233..237
public/widgets/person/widget.js on lines 240..244
public/widgets/person/widget.js on lines 247..251
public/widgets/person/widget.js on lines 254..258
public/widgets/person/widget.js on lines 262..266
public/widgets/person/widget.js on lines 270..274
public/widgets/person/widget.js on lines 278..282
public/widgets/widget-builder/widget.js on lines 198..202
public/widgets/zip/widget.js on lines 133..137
public/widgets/zip/widget.js on lines 144..148
public/widgets/zip/widget.js on lines 155..159
public/widgets/zip/widget.js on lines 166..170
public/widgets/zip/widget.js on lines 177..181

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

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

          if(paramsDiv) {
            if (jQuery(paramsDiv).find('.partner-logo').length > 0) partnerLogo = jQuery(paramsDiv).find('.partner-logo').html();
          } else if (typeof jQuery(this).data('partner-logo') !== "undefined") {
            partnerLogo = jQuery(this).data('partner-logo');
          }
Severity: Major
Found in public/widgets/address/widget.js and 24 other locations - About 3 hrs to fix
public/widgets/address/widget.js on lines 198..202
public/widgets/address/widget.js on lines 214..218
public/widgets/address/widget.js on lines 222..226
public/widgets/address/widget.js on lines 230..234
public/widgets/person/widget.js on lines 189..193
public/widgets/person/widget.js on lines 197..201
public/widgets/person/widget.js on lines 205..209
public/widgets/person/widget.js on lines 212..216
public/widgets/person/widget.js on lines 219..223
public/widgets/person/widget.js on lines 226..230
public/widgets/person/widget.js on lines 233..237
public/widgets/person/widget.js on lines 240..244
public/widgets/person/widget.js on lines 247..251
public/widgets/person/widget.js on lines 254..258
public/widgets/person/widget.js on lines 262..266
public/widgets/person/widget.js on lines 270..274
public/widgets/person/widget.js on lines 278..282
public/widgets/widget-builder/widget.js on lines 190..194
public/widgets/widget-builder/widget.js on lines 198..202
public/widgets/zip/widget.js on lines 133..137
public/widgets/zip/widget.js on lines 144..148
public/widgets/zip/widget.js on lines 155..159
public/widgets/zip/widget.js on lines 166..170
public/widgets/zip/widget.js on lines 177..181

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

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

          if(paramsDiv) {
            if (jQuery(paramsDiv).find('.headline').length > 0) headline = jQuery(paramsDiv).find('.headline').html();
          } else if (typeof jQuery(this).data('headline') !== "undefined") {
            headline = jQuery(this).data('headline');
          }
Severity: Major
Found in public/widgets/person/widget.js and 24 other locations - About 3 hrs to fix
public/widgets/address/widget.js on lines 198..202
public/widgets/address/widget.js on lines 206..210
public/widgets/address/widget.js on lines 214..218
public/widgets/address/widget.js on lines 222..226
public/widgets/address/widget.js on lines 230..234
public/widgets/person/widget.js on lines 189..193
public/widgets/person/widget.js on lines 197..201
public/widgets/person/widget.js on lines 205..209
public/widgets/person/widget.js on lines 212..216
public/widgets/person/widget.js on lines 219..223
public/widgets/person/widget.js on lines 226..230
public/widgets/person/widget.js on lines 233..237
public/widgets/person/widget.js on lines 240..244
public/widgets/person/widget.js on lines 247..251
public/widgets/person/widget.js on lines 254..258
public/widgets/person/widget.js on lines 270..274
public/widgets/person/widget.js on lines 278..282
public/widgets/widget-builder/widget.js on lines 190..194
public/widgets/widget-builder/widget.js on lines 198..202
public/widgets/zip/widget.js on lines 133..137
public/widgets/zip/widget.js on lines 144..148
public/widgets/zip/widget.js on lines 155..159
public/widgets/zip/widget.js on lines 166..170
public/widgets/zip/widget.js on lines 177..181

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

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

          if(paramsDiv) {
            if (jQuery(paramsDiv).find('.intro-explanatory').length > 0) questionSummary = jQuery(paramsDiv).find('.intro-explanatory').html();
          } else if (typeof jQuery(this).data('intro-explanatory') !== "undefined") {
            explanatory = jQuery(this).data('intro-explanatory');
          }
Severity: Major
Found in public/widgets/widget-builder/widget.js and 24 other locations - About 3 hrs to fix
public/widgets/address/widget.js on lines 198..202
public/widgets/address/widget.js on lines 206..210
public/widgets/address/widget.js on lines 214..218
public/widgets/address/widget.js on lines 222..226
public/widgets/address/widget.js on lines 230..234
public/widgets/person/widget.js on lines 189..193
public/widgets/person/widget.js on lines 197..201
public/widgets/person/widget.js on lines 205..209
public/widgets/person/widget.js on lines 212..216
public/widgets/person/widget.js on lines 219..223
public/widgets/person/widget.js on lines 226..230
public/widgets/person/widget.js on lines 233..237
public/widgets/person/widget.js on lines 240..244
public/widgets/person/widget.js on lines 247..251
public/widgets/person/widget.js on lines 254..258
public/widgets/person/widget.js on lines 262..266
public/widgets/person/widget.js on lines 270..274
public/widgets/person/widget.js on lines 278..282
public/widgets/widget-builder/widget.js on lines 190..194
public/widgets/zip/widget.js on lines 133..137
public/widgets/zip/widget.js on lines 144..148
public/widgets/zip/widget.js on lines 155..159
public/widgets/zip/widget.js on lines 166..170
public/widgets/zip/widget.js on lines 177..181

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

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