mgcrea/angular-strap

View on GitHub

Showing 611 of 611 total issues

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

      it('should ignore exotic placements', function () {
        var exotic = viewportPlacements['options-placement-viewport-exotic'];

        expect(exotic.top).toBe('20px');
        expect(exotic.left).toBe('-80px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442

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

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

      it('should shift down when positioning results in being outsie of the viewport', function () {
        var right = viewportPlacements['options-placement-viewport-right'];

        expect(right.top).toBe('0px');
        expect(right.left).toBe('20px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the bottom-right of the target when placement is `bottom-right`', function () {
        var placement = standardPlacements['options-placement-exotic-bottom-right'];

        expect(placement.top).toBe('20px');
        expect(placement.left).toBe('-180px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip above the target when placement is `top`', function () {
        var placement = standardPlacements['options-placement-top'];

        expect(placement.top).toBe('-100px');
        expect(placement.left).toBe('-90px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should shift left when positioning results in being outside of the viewport', function () {
        var bottom = viewportPlacements['options-placement-viewport-bottom'];

        expect(bottom.top).toBe('20px');
        expect(bottom.left).toBe('100px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should shift right when positioning results in being outside of the viewport', function () {
        var top = viewportPlacements['options-placement-viewport-top'];

        expect(top.top).toBe('80px');
        expect(top.left).toBe('0px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should use the padding to position the tooltip from the edge of the viewport', function () {
        var padding = viewportPlacements['options-placement-viewport-padding'];

        expect(padding.top).toBe('10px');
        expect(padding.left).toBe('20px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the right-top of the target when placement is `right-top`', function () {
        var placement = standardPlacements['options-placement-exotic-right-top'];

        expect(placement.top).toBe('-80px');
        expect(placement.left).toBe('20px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the bottom-left of the target when placement is `bottom-left`', function () {
        var placement = standardPlacements['options-placement-exotic-bottom-left'];

        expect(placement.top).toBe('20px');
        expect(placement.left).toBe('0px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the top-left of the target when placement is `top-left`', function () {
        var placement = standardPlacements['options-placement-exotic-top-left'];

        expect(placement.top).toBe('-100px');
        expect(placement.left).toBe('0px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the left-top of the target when placement is `left-top`', function () {
        var placement = standardPlacements['options-placement-exotic-left-top'];

        expect(placement.top).toBe('-80px');
        expect(placement.left).toBe('-200px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the top-right of the target when placement is `top-right`', function () {
        var placement = standardPlacements['options-placement-exotic-top-right'];

        expect(placement.top).toBe('-100px');
        expect(placement.left).toBe('-180px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip below the target when placement is `bottom`', function () {
        var placement = standardPlacements['options-placement-bottom'];

        expect(placement.top).toBe('20px');
        expect(placement.left).toBe('-90px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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('useNative', function() {

      it('should correctly compile template according to useNative', function() {
        var elm = compileDirective('options-useNative');
        angular.element(elm[0]).triggerHandler('focus');
Severity: Major
Found in src/timepicker/test/timepicker.spec.js and 1 other location - About 1 hr to fix
src/datepicker/test/datepicker.spec.js on lines 1191..1199

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

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('useNative', function() {

      it('should correctly compile template according to useNative', function() {
        var elm = compileDirective('options-useNative');
        angular.element(elm[0]).triggerHandler('focus');
Severity: Major
Found in src/datepicker/test/datepicker.spec.js and 1 other location - About 1 hr to fix
src/timepicker/test/timepicker.spec.js on lines 1163..1171

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

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

Function $parseOffsets has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        $affix.$parseOffsets = function () {
          var initialPosition = element[0].style.position;
          var initialTop = element[0].style.top;
          // Reset position to calculate correct offsetTop
          if (options.inlineStyles) {
Severity: Minor
Found in src/affix/affix.js - About 1 hr to fix

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

      expect(elm.val()).toBe((today.getMonth() + 1) + '/15/' + (today.getFullYear() + '').substr(2));
Severity: Major
Found in src/datepicker/test/datepicker.spec.js and 1 other location - About 1 hr to fix
src/datepicker/test/datepicker.spec.js on lines 310..310

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      expect(elm.val()).toBe(nextMonthAndYear.getMonth() + 1 + '/1/' + (nextMonthAndYear.getFullYear() + '').substr(2));
Severity: Major
Found in src/datepicker/test/datepicker.spec.js and 1 other location - About 1 hr to fix
src/datepicker/test/datepicker.spec.js on lines 295..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 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      expect(elm.val()).toBe(jQuery('<div></div>').html(scope.icons[1].fr_FR).text().trim());
Severity: Major
Found in src/typeahead/test/typeahead.spec.js and 2 other locations - About 1 hr to fix
src/typeahead/test/typeahead.spec.js on lines 284..284
src/typeahead/test/typeahead.spec.js on lines 298..298

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      expect(elm.val()).toBe(jQuery('<div></div>').html(scope.icons[0].fr_FR).text().trim());
Severity: Major
Found in src/typeahead/test/typeahead.spec.js and 2 other locations - About 1 hr to fix
src/typeahead/test/typeahead.spec.js on lines 284..284
src/typeahead/test/typeahead.spec.js on lines 291..291

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

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