mgcrea/angular-strap

View on GitHub

Showing 611 of 611 total issues

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

        angular.forEach(['html', 'container', 'trimValue', 'filter'], function (key) {
          if (angular.isDefined(attr[key]) && falseValueRegExp.test(attr[key])) options[key] = false;
        });
Severity: Major
Found in src/typeahead/typeahead.js and 3 other locations - About 1 hr to fix
src/alert/alert.js on lines 79..81
src/aside/aside.js on lines 57..59
src/modal/modal.js on lines 468..470

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

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 postLink has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      link: function postLink (scope, element, attr, transclusion) {

        // Directive options
        var options = {scope: scope, element: element, show: false};
        angular.forEach(['template', 'templateUrl', 'controller', 'controllerAs', 'placement', 'keyboard', 'html', 'container', 'animation', 'duration', 'dismissable'], function (key) {
Severity: Minor
Found in src/alert/alert.js - About 1 hr to fix

Function checkPosition has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        $affix.checkPosition = function () {
          // if (!this.$element.is(':visible')) return

          var scrollTop = getScrollTop();
          var position = dimensions.offset(element[0]);
Severity: Minor
Found in src/affix/affix.js - About 1 hr to fix

Function postLink has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        return function postLink (scope, element, attr) {

          // Directive options
          var options = {
            scope: scope
Severity: Minor
Found in src/dropdown/dropdown.js - About 1 hr to fix

Function applyPlacement has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function applyPlacement (offset, placement) {
          var tip = tipElement[0];
          var width = tip.offsetWidth;
          var height = tip.offsetHeight;

Severity: Minor
Found in src/tooltip/tooltip.js - About 1 hr to fix

Function postLink has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      link: function postLink (scope, element, attr, transclusion) {
        // Directive options
        var options = {scope: scope, element: element, show: false};
        angular.forEach(['template', 'templateUrl', 'controller', 'controllerAs', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function (key) {
          if (angular.isDefined(attr[key])) options[key] = attr[key];
Severity: Minor
Found in src/aside/aside.js - About 1 hr to fix

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

      it('should support now as maxTime', function() {
        var elm = compileDirective('options-maxTime-now');
        angular.element(elm[0]).triggerHandler('focus');
        var todayHour = today.getHours();
        // @TODO fixme
Severity: Major
Found in src/timepicker/test/timepicker.spec.js and 1 other location - About 1 hr to fix
src/timepicker/test/timepicker.spec.js on lines 1008..1014

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

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

      it('should support now as minTime', function() {
        var elm = compileDirective('options-minTime-now');
        angular.element(elm[0]).triggerHandler('focus');
        var todayHour = today.getHours();
        // @TODO fixme
Severity: Major
Found in src/timepicker/test/timepicker.spec.js and 1 other location - About 1 hr to fix
src/timepicker/test/timepicker.spec.js on lines 1090..1096

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

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 postLink has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      link: function postLink (scope, element, attr, controller) {

        var options = defaults;

        // Support label > input[type="checkbox"]
Severity: Minor
Found in src/button/button.js - About 1 hr to fix

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

        angular.forEach(['template', 'templateUrl', 'controller', 'controllerAs', 'placement', 'keyboard', 'html', 'container', 'animation', 'duration', 'dismissable'], function (key) {
          if (angular.isDefined(attr[key])) options[key] = attr[key];
        });
Severity: Major
Found in src/alert/alert.js and 1 other location - About 1 hr to fix
src/aside/aside.js on lines 51..53

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

            hours.push({
              date: hour,
              label: formatDate(hour, hoursFormat),
              selected: $timepicker.$date && $timepicker.$isSelected(hour, 0),
              disabled: $timepicker.$isDisabled(hour, 0)
Severity: Major
Found in src/timepicker/timepicker.js and 2 other locations - About 1 hr to fix
src/timepicker/timepicker.js on lines 170..175
src/timepicker/timepicker.js on lines 181..186

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

            minutes.push({
              date: minute,
              label: formatDate(minute, minutesFormat),
              selected: $timepicker.$date && $timepicker.$isSelected(minute, 1),
              disabled: $timepicker.$isDisabled(minute, 1)
Severity: Major
Found in src/timepicker/timepicker.js and 2 other locations - About 1 hr to fix
src/timepicker/timepicker.js on lines 159..164
src/timepicker/timepicker.js on lines 181..186

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

            seconds.push({
              date: second,
              label: formatDate(second, secondsFormat),
              selected: $timepicker.$date && $timepicker.$isSelected(second, 2),
              disabled: $timepicker.$isDisabled(second, 2)
Severity: Major
Found in src/timepicker/timepicker.js and 2 other locations - About 1 hr to fix
src/timepicker/timepicker.js on lines 159..164
src/timepicker/timepicker.js on lines 170..175

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

        angular.forEach(['template', 'templateUrl', 'controller', 'controllerAs', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function (key) {
          if (angular.isDefined(attr[key])) options[key] = attr[key];
        });
Severity: Major
Found in src/aside/aside.js and 1 other location - About 1 hr to fix
src/alert/alert.js on lines 73..75

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

Function $get has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    this.$get = function ($window, $rootScope, $bsCompiler, $q, $templateCache, $http, $animate, $sce, dimensions, $$rAF, $timeout) {
Severity: Major
Found in src/tooltip/tooltip.js - About 1 hr to fix

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

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

        expect(placement.top).toBe('-40px');
        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 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 up when positioning results in being outside of the viewport', function () {
        var top = viewportPlacements['options-placement-viewport-left'];

        expect(top.top).toBe('100px');
        expect(top.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 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 of the target when placement is `left`', function () {
        var placement = standardPlacements['options-placement-left'];

        expect(placement.top).toBe('-40px');
        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 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 position the tooltip to the left-bottom of the target when placement is `left-bottom`', function () {
        var placement = standardPlacements['options-placement-exotic-left-bottom'];

        expect(placement.top).toBe('0px');
        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 1305..1310
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 right-bottom of the target when placement is `right-bottom`', function () {
        var placement = standardPlacements['options-placement-exotic-right-bottom'];

        expect(placement.top).toBe('0px');
        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 1319..1324
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

Severity
Category
Status
Source
Language