opengovernment/askthem

View on GitHub

Showing 70 of 154 total issues

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/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 206..210
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('.partner-url').length > 0) partnerUrl = jQuery(paramsDiv).find('.partner-url').html();
          } else if (typeof jQuery(this).data('partner-url') !== "undefined") {
            partnerUrl = jQuery(this).data('partner-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 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('.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/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 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-state').length > 0) personState = jQuery(paramsDiv).find('.person-state').html();
          } else if (typeof jQuery(this).data('person-state') !== "undefined") {
            personState = jQuery(this).data('person-state');
          }
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 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-name').length > 0) personName = jQuery(paramsDiv).find('.person-name').html();
          } else if (typeof jQuery(this).data('person-name') !== "undefined") {
            personName = jQuery(this).data('person-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 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 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('.question-summary').length > 0) questionSummary = jQuery(paramsDiv).find('.question-summary').html();
          } else if (typeof jQuery(this).data('question-summary') !== "undefined") {
            questionSummary = jQuery(this).data('question-summary');
          }
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 206..210
public/widgets/address/widget.js on lines 214..218
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('.question-summary').length > 0) questionSummary = jQuery(paramsDiv).find('.question-summary').html();
          } else if (typeof jQuery(this).data('question-summary') !== "undefined") {
            questionSummary = jQuery(this).data('question-summary');
          }
Severity: Major
Found in public/widgets/zip/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/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 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-url').length > 0) partnerUrl = jQuery(paramsDiv).find('.partner-url').html();
          } else if (typeof jQuery(this).data('partner-url') !== "undefined") {
            partnerUrl = jQuery(this).data('partner-url');
          }
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 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/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-party').length > 0) personParty = jQuery(paramsDiv).find('.person-party').html();
          } else if (typeof jQuery(this).data('person-party') !== "undefined") {
            personParty = jQuery(this).data('person-party');
          }
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 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('.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/zip/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/widget-builder/widget.js on lines 198..202
public/widgets/zip/widget.js on lines 133..137
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('.question-body').length > 0) questionBody = jQuery(paramsDiv).find('.question-body').html();
          } else if (typeof jQuery(this).data('question-body') !== "undefined") {
            questionBody = jQuery(this).data('question-body');
          }
Severity: Major
Found in public/widgets/zip/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/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

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-id').length > 0) personId = jQuery(paramsDiv).find('.person-id').html();
          } else if (typeof jQuery(this).data('person-id') !== "undefined") {
            personId = jQuery(this).data('person-id');
          }
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 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('.partner-url').length > 0) partnerUrl = jQuery(paramsDiv).find('.partner-url').html();
          } else if (typeof jQuery(this).data('partner-url') !== "undefined") {
            partnerUrl = jQuery(this).data('partner-url');
          }
Severity: Major
Found in public/widgets/zip/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/widget-builder/widget.js on lines 198..202
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('.question-body').length > 0) questionBody = jQuery(paramsDiv).find('.question-body').html();
          } else if (typeof jQuery(this).data('question-body') !== "undefined") {
            questionBody = jQuery(this).data('question-body');
          }
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 206..210
public/widgets/address/widget.js on lines 214..218
public/widgets/address/widget.js on lines 222..226
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('.person-political-position-title').length > 0) personPoliticalPositionTitle = jQuery(paramsDiv).find('.person-political-position-title').html();
          } else if (typeof jQuery(this).data('person-political-position-title') !== "undefined") {
            personPoliticalPositionTitle = jQuery(this).data('person-political-position-title');
          }
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 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-most-recent-district').length > 0) personMostRecentDistrict = jQuery(paramsDiv).find('.person-most-recent-district').html();
          } else if (typeof jQuery(this).data('person-most-recent-district') !== "undefined") {
            personMostRecentDistrict = jQuery(this).data('person-most-recent-district');
          }
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 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('.question-summary').length > 0) questionSummary = jQuery(paramsDiv).find('.question-summary').html();
          } else if (typeof jQuery(this).data('question-summary') !== "undefined") {
            questionSummary = jQuery(this).data('question-summary');
          }
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 262..266
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('.question-body').length > 0) questionBody = jQuery(paramsDiv).find('.question-body').html();
          } else if (typeof jQuery(this).data('question-body') !== "undefined") {
            questionBody = jQuery(this).data('question-body');
          }
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 262..266
public/widgets/person/widget.js on lines 270..274
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/zip/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/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 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

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

  function addCssLinksIfNecessary(cssUrls) {
    jQuery.each(cssUrls, function(key, value) {
      var cssSelector = "link[href='"+ value + "']";

      if (!jQuery(cssSelector).length) {
Severity: Major
Found in public/widgets/person/widget.js and 2 other locations - About 3 hrs to fix
public/widgets/address/widget.js on lines 135..149
public/widgets/widget-builder/widget.js on lines 135..149

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

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