koinejs/Decorators

View on GitHub

Showing 14 of 14 total issues

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

    it("triggers 'change' when value changes", function () {
      subject.setValue('abc');

      subject.on('change', function (e) {
        output.push(e.type);
Severity: Major
Found in specs/helpers/shared_behaviours.js and 1 other location - About 4 hrs to fix
specs/helpers/shared_behaviours.js on lines 139..150

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 128.

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

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

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

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

Refactorings

Further Reading

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

    xit("triggers 'change:value' when value changes", function () {
      subject.setValue('abc');

      subject.on('change:value', function (e) {
        output.push(e.type);
Severity: Major
Found in specs/helpers/shared_behaviours.js and 1 other location - About 4 hrs to fix
specs/helpers/shared_behaviours.js on lines 126..137

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 128.

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

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

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

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

Refactorings

Further Reading

Function behavesLikeADomElementDecorator has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function behavesLikeADomElementDecorator(describedClassName) {
  eval('var describedClass = ' + describedClassName);
  var subject, element;

  beforeEach(function () {
Severity: Major
Found in specs/helpers/shared_behaviours.js - About 3 hrs to fix

    Function exports has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
      grunt.initConfig({
        jshint: {
          options: {
            jshintrc: '.jshintrc'
    Severity: Major
    Found in Gruntfile.js - About 2 hrs to fix

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

      function behavesLikeAnInputDecorator(describedClassName) {
        eval('var describedClass = ' + describedClassName);
        var subject, element, output = [];
      
        beforeEach(function () {
      Severity: Minor
      Found in specs/helpers/shared_behaviours.js - About 1 hr to fix

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

          describe("#getId()", function () {
            it("gets the id", function () {
              var value = subject.setId('foo').getId();
              expect(value).toBe('foo');
            });
        Severity: Major
        Found in specs/helpers/shared_behaviours.js and 1 other location - About 1 hr to fix
        specs/helpers/shared_behaviours.js on lines 96..101

        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

          describe("#hetHtml()", function () {
            it("gets the inner html", function () {
              var html = subject.setHtml('foo').getHtml();
              expect(html).toBe('foo');
            });
        Severity: Major
        Found in specs/helpers/shared_behaviours.js and 1 other location - About 1 hr to fix
        specs/helpers/shared_behaviours.js on lines 82..87

        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

            it("removes an option from the end of the array", function () {
              subject.addOptions([a, b, c]).removeOption(c);
              expect(subject.getOptions()).toEqual([a, b]);
            });
        Severity: Major
        Found in specs/Koine.Decorators.Dom.SelectDecorator_spec.js and 2 other locations - About 1 hr to fix
        specs/Koine.Decorators.Dom.SelectDecorator_spec.js on lines 97..100
        specs/Koine.Decorators.Dom.SelectDecorator_spec.js on lines 107..110

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

        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

            it("removes an option from the middle of the array", function () {
              subject.addOptions([a, b, c]).removeOption(b);
              expect(subject.getOptions()).toEqual([a, c]);
            });
        Severity: Major
        Found in specs/Koine.Decorators.Dom.SelectDecorator_spec.js and 2 other locations - About 1 hr to fix
        specs/Koine.Decorators.Dom.SelectDecorator_spec.js on lines 97..100
        specs/Koine.Decorators.Dom.SelectDecorator_spec.js on lines 102..105

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

        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

            it("removes an option from the beggining of the array", function () {
              subject.addOptions([a, b, c]).removeOption(a);
              expect(subject.getOptions()).toEqual([b, c]);
            });
        Severity: Major
        Found in specs/Koine.Decorators.Dom.SelectDecorator_spec.js and 2 other locations - About 1 hr to fix
        specs/Koine.Decorators.Dom.SelectDecorator_spec.js on lines 102..105
        specs/Koine.Decorators.Dom.SelectDecorator_spec.js on lines 107..110

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

        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

          describe("#getLabel()", function () {
            it("gets the label of the element", function () {
              element.innerHTML = 'php';
              expect(subject.getLabel()).toEqual('php');
            });
        Severity: Major
        Found in specs/Koine.Decorators.Dom.SelectOptionDecorator_spec.js and 1 other location - About 1 hr to fix
        specs/helpers/shared_behaviours.js on lines 113..118

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

        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

          describe("#getValue()", function () {
            it("gets the value", function () {
              element.value = 'foo';
              expect(subject.getValue()).toBe('foo');
            });
        Severity: Major
        Found in specs/helpers/shared_behaviours.js and 1 other location - About 1 hr to fix
        specs/Koine.Decorators.Dom.SelectOptionDecorator_spec.js on lines 21..26

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

        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("sets the value", function () {
              var value = subject.setValue('foo').getElement().value;
              expect(value).toBe('foo');
            });
        Severity: Minor
        Found in specs/helpers/shared_behaviours.js and 1 other location - About 55 mins to fix
        specs/helpers/shared_behaviours.js on lines 90..93

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

        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("sets the inner html", function () {
              var html = subject.setHtml('foo').getElement().innerHTML;
              expect(html).toBe('foo');
            });
        Severity: Minor
        Found in specs/helpers/shared_behaviours.js and 1 other location - About 55 mins to fix
        specs/helpers/shared_behaviours.js on lines 121..124

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

        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