deltreey/wildstring

View on GitHub

Showing 46 of 55 total issues

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

  describe('#replace', function() {
      it('sholud return the pattern when no wildcard is given', function() {
          // Given: a string array and a pattern with no wildcards
          var pattern = 'test',
                  strings = ['testing'];
Severity: Major
Found in karma-test/test.js and 1 other location - About 1 day to fix
test/test.js on lines 298..341

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

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

  describe('#replace', function() {
      it('sholud return the pattern when no wildcard is given', function() {
          // Given: a string array and a pattern with no wildcards
          var pattern = 'test',
                  strings = ['testing'];
Severity: Major
Found in test/test.js and 1 other location - About 1 day to fix
karma-test/test.js on lines 284..327

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

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

      it('should work with case sensitivity off', function() {
          // Given: a string that does not match the case of the pattern, and case sensitivity is off
          wildstring.caseSensitive = false;
          var pattern = '*TEST',
                  string = 'TeSt';
Severity: Major
Found in karma-test/test.js and 1 other location - About 1 hr to fix
test/test.js on lines 272..283

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

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

      it('should work with case sensitivity off', function() {
          // Given: a string that does not match the case of the pattern, and case sensitivity is off
          wildstring.caseSensitive = false;
          var pattern = '*TEST',
                  string = 'TeSt';
Severity: Major
Found in test/test.js and 1 other location - About 1 hr to fix
karma-test/test.js on lines 258..269

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

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

      it('should match longer strings if the pattern begins with multiple wildcards', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = '***ing',
                  string = 'testing';

Severity: Major
Found in test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match everything if the pattern is only wildcards', function() {
          // Given: any string and a pattern that is only wildcards
          var pattern = '***',
                  string = 'test';

Severity: Major
Found in karma-test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should work with multiple wildcards in the middle and at the beginning', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = '*test*ing',
                  string = 'I\'m testing';

Severity: Major
Found in test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match exactly when no wildcard is given', function() {
          // Given: a string and a pattern that match
          var pattern = 'test',
                  string = 'test';

Severity: Major
Found in karma-test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match longer strings if the pattern ends with a wildcard', function() {
          // Given: a string that is longer than the pattern, but matches up to the wildcard, and the pattern
          var pattern = 'test*',
                  string = 'testing';

Severity: Major
Found in test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match matching strings even if the pattern begins with a wildcard', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = '*ing',
                  string = 'testing';

Severity: Major
Found in test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should return false if the string doesn\'t match the pattern and no wildcard is given, even when shorter', function() {
          // Given: a string and a pattern that don't match
          var pattern = 'testing',
                  string = '';

Severity: Major
Found in karma-test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match matching strings even if the pattern ends with a wildcard', function() {
          // Given: a string that is longer than the pattern, but matches up to the wildcard, and the pattern
          var pattern = 'test*',
                  string = 'test';

Severity: Major
Found in test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match strings that match the beginning and end with a wildcard in the middle', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = 'bow*ing',
                  string = 'bowstring';

Severity: Major
Found in test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should work with multiple wildcards in the middle', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = 'te*st*ing',
                  string = 'tea string';

Severity: Major
Found in karma-test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should not match strings that have extra characters at the beginning when the pattern doesn\'t begin with a wildcard', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = 'ing*',
                  string = 'testing';

Severity: Major
Found in test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match matching strings even if there\'s a wildcard in the middle', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = 'test*ing',
                  string = 'testing';

Severity: Major
Found in test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should not match strings that have extra characters at the end when the pattern doesn\'t end with a wildcard', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = '*ing',
                  string = 'ings';

Severity: Major
Found in karma-test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match matching strings even if the pattern ends with multiple wildcards', function() {
          // Given: a string that is longer than the pattern, but matches up to the wildcard, and the pattern
          var pattern = 'test***',
                  string = 'test';

Severity: Major
Found in karma-test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match longer strings if the pattern begins with a wildcard', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = '*ing',
                  string = 'testing';

Severity: Major
Found in karma-test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 174..184
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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

      it('should match matching strings even if there\'s a wildcard in the middle', function() {
          // Given: a string that is longer than the pattern, but matches after to the wildcard, and the pattern
          var pattern = 'test*ing',
                  string = 'testing';

Severity: Major
Found in karma-test/test.js and 41 other locations - About 1 hr to fix
karma-test/test.js on lines 18..28
karma-test/test.js on lines 30..40
karma-test/test.js on lines 42..52
karma-test/test.js on lines 54..64
karma-test/test.js on lines 66..76
karma-test/test.js on lines 78..88
karma-test/test.js on lines 90..100
karma-test/test.js on lines 102..112
karma-test/test.js on lines 114..124
karma-test/test.js on lines 126..136
karma-test/test.js on lines 138..148
karma-test/test.js on lines 150..160
karma-test/test.js on lines 162..172
karma-test/test.js on lines 186..196
karma-test/test.js on lines 198..208
karma-test/test.js on lines 210..220
karma-test/test.js on lines 222..232
karma-test/test.js on lines 234..244
karma-test/test.js on lines 246..256
karma-test/test.js on lines 271..281
test/test.js on lines 12..22
test/test.js on lines 44..54
test/test.js on lines 56..66
test/test.js on lines 68..78
test/test.js on lines 80..90
test/test.js on lines 92..102
test/test.js on lines 104..114
test/test.js on lines 116..126
test/test.js on lines 128..138
test/test.js on lines 140..150
test/test.js on lines 152..162
test/test.js on lines 164..174
test/test.js on lines 176..186
test/test.js on lines 188..198
test/test.js on lines 200..210
test/test.js on lines 212..222
test/test.js on lines 224..234
test/test.js on lines 236..246
test/test.js on lines 248..258
test/test.js on lines 260..270
test/test.js on lines 285..295

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

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