gngeorgiev/firesync

View on GitHub

Showing 23 of 23 total issues

File firesync-test.js has 523 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var firesync;
var Firebase;

Severity: Major
Found in test/firesync-test.js - About 1 day to fix

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

                it('should remove object from start', function (done) {
                    obj = new FiresyncArray(testRef);
                    [1,2,3,4,5].forEach(function (i) {
                        obj.add(i);
                    });
    Severity: Major
    Found in test/firesync-test.js and 2 other locations - About 1 day to fix
    test/firesync-test.js on lines 377..391
    test/firesync-test.js on lines 409..423

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

    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('should remove object on middle index', function (done) {
                    obj = new FiresyncArray(testRef);
                    [1,2,3,4,5].forEach(function (i) {
                        obj.add(i);
                    });
    Severity: Major
    Found in test/firesync-test.js and 2 other locations - About 1 day to fix
    test/firesync-test.js on lines 393..407
    test/firesync-test.js on lines 409..423

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

    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('should remove object from end', function (done) {
                    obj = new FiresyncArray(testRef);
                    [1,2,3,4,5].forEach(function (i) {
                        obj.add(i);
                    });
    Severity: Major
    Found in test/firesync-test.js and 2 other locations - About 1 day to fix
    test/firesync-test.js on lines 377..391
    test/firesync-test.js on lines 393..407

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

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

        _attach() {
            Object.observe(this, (args) => {
                let filteredArgs = _.chain(args)
                .filter((arg) => {
                    return !this.$$.FILTERED_PROPERTIES.has(arg.name);
    Severity: Major
    Found in src/firesyncBase.js - About 3 hrs to fix

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

                      domTimeout(function () {
                          expect(container.childElementCount).to.equal(1);
                          expect(container.children[0].nodeName).to.equal('INPUT');
                          expect(container.children[0].value).to.equal('pesho');
                      }, done)
      Severity: Major
      Found in test/firesync-test.js and 1 other location - About 2 hrs to fix
      test/firesync-test.js on lines 147..151

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

      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

                      domTimeout(function () {
                          expect(container.childElementCount).to.equal(1);
                          expect(container.children[0].nodeName).to.equal('INPUT');
                          expect(container.children[0].value).to.equal('');
                      })
      Severity: Major
      Found in test/firesync-test.js and 1 other location - About 2 hrs to fix
      test/firesync-test.js on lines 131..135

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

      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

      File firesyncBase.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      import { EventEmitter2 } from 'eventemitter2';
      import _ from 'lodash';
      import queue from 'queue';
      Severity: Minor
      Found in src/firesyncBase.js - About 2 hrs to fix

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

                    it('should fire loaded event', function (done) {
                        obj = new FiresyncObject(testRef);
                        obj.once('loaded', function () {
                            expect(this.loaded()).to.equal(true);
                            done();
        Severity: Major
        Found in test/firesync-test.js and 1 other location - About 1 hr to fix
        test/firesync-test.js on lines 296..302

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 74.

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

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

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

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

        Refactorings

        Further Reading

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

                    it('should fire loaded event', function (done) {
                        obj = new FiresyncArray(testRef);
                        obj.once('loaded', function () {
                            expect(this.loaded()).to.equal(true);
                            done();
        Severity: Major
        Found in test/firesync-test.js and 1 other location - About 1 hr to fix
        test/firesync-test.js on lines 229..235

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 74.

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

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

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

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

        Refactorings

        Further Reading

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

            _updateBindings(changes, origin, target = constants.BINDING_TARGET.ANY, force = false) {
                return new Promise((resolve) => {
                    let bindingQueue = queue();
        
                    this.$$.bindings.forEach((binding) => {
        Severity: Minor
        Found in src/firesyncBase.js - About 1 hr to fix

          Function bindTo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              bindTo(settings) {
                  _.extend(settings, {
                      data: this
                  });
          
          
          Severity: Minor
          Found in src/firesyncBase.js - About 1 hr to fix

            Function handler has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            let handler = (snap, prevChild) => {
                                let property = snap.key();
                                let value = snap.val();
                                let type;
            
            
            Severity: Minor
            Found in src/firesyncBase.js - About 1 hr to fix

              Function map has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function map(ref) {
                  return new Promise((resolve) => {
                      ref.once('value', (snap) => {
                          let val = snap.val();
              
              
              Severity: Minor
              Found in src/firesync.js - About 1 hr to fix

                Function queuedBinding has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                let queuedBinding = (cb) => {
                                    if (binding.inProgress && binding.origin !== origin && !force) {
                                        return cb();
                                    }
                
                
                Severity: Minor
                Found in src/firesyncBase.js - About 1 hr to fix

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

                          return super._updateBindings({
                              property: key,
                              value: value,
                              type: constants.CHANGE_TYPE.ADD
                          }, constants.CHANGE_ORIGIN.LOCAL, constants.BINDING_TARGET.FIREBASE);
                  Severity: Minor
                  Found in src/firesyncArray.js and 1 other location - About 55 mins to fix
                  src/firesyncArray.js on lines 91..95

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

                  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

                          return super._updateBindings({
                              property: key,
                              value: val,
                              type: constants.CHANGE_TYPE.UPDATE
                          }, constants.CHANGE_ORIGIN.LOCAL, constants.BINDING_TARGET.FIREBASE);
                  Severity: Minor
                  Found in src/firesyncArray.js and 1 other location - About 55 mins to fix
                  src/firesyncArray.js on lines 121..125

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

                  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

                      updateLocal(cb) {
                          if (FiresyncBinding._isOnlyCallback(arguments)) {
                              return this._updateLocal = cb;
                          }
                  
                  
                  Severity: Minor
                  Found in src/firesyncBinding.js and 1 other location - About 50 mins to fix
                  src/firesyncBinding.js on lines 46..52

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

                  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

                      updateForeign(cb) {
                          if (FiresyncBinding._isOnlyCallback(arguments)) {
                              return this._updateForeign = cb;
                          }
                  
                  
                  Severity: Minor
                  Found in src/firesyncBinding.js and 1 other location - About 50 mins to fix
                  src/firesyncBinding.js on lines 38..44

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

                  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 not be loaded initially', function () {
                                  obj = new FiresyncArray(testRef);
                                  expect(obj.loaded()).to.equal(false);
                              });
                  Severity: Minor
                  Found in test/firesync-test.js and 1 other location - About 45 mins to fix
                  test/firesync-test.js on lines 224..227

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

                  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