katrotz/splitify

View on GitHub

Showing 98 of 98 total issues

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

  _.forEach(['beforeEach', 'afterEach', 'beforeAll', 'afterAll'], function (word) {
    var originalFunction = this[word]
    this[word] = function (/* arguments */) {
      arguments[0] = markBottom(arguments[0])
      return originalFunction.apply(this, arguments)
Severity: Major
Found in packages/meteor-jasmine/src/lib/JasmineInterface.js and 1 other location - About 1 hr to fix
packages/meteor-jasmine/src/lib/JasmineInterface.js on lines 42..48

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

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

  _.forEach(['describe', 'xdescribe', 'fdescribe', 'it', 'fit'], function (word) {
    var originalFunction = this[word]
    this[word] = function (/* arguments */) {
      arguments[1] = markBottom(arguments[1])
      return originalFunction.apply(this, arguments)
Severity: Major
Found in packages/meteor-jasmine/src/lib/JasmineInterface.js and 1 other location - About 1 hr to fix
packages/meteor-jasmine/src/lib/JasmineInterface.js on lines 50..56

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

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 executeSpecsUnitMode has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  runTests: function executeSpecsUnitMode() {
    Meteor.call('velocity/reports/reset', {framework: this.name})

    if (this._getTestFilesCursor().count() === 0) {
      this._reportCompleted()
Severity: Minor
Found in packages/meteor-jasmine/src/server/unit/ServerUnitTestFramework.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function parse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

parseStack.parse = function (err) {
  var frames = err.stack.split('\n');

  frames.shift(); // at least the first line is the exception
  var stop = false;
Severity: Minor
Found in packages/meteor-jasmine/src/lib/parseStack.js - About 1 hr to fix

    Function _executeClientTests has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _executeClientTests: function (ddpConnection) {
        var self = this;
    
        window.ddpParentConnection = ddpConnection
    
    

      Function saveTestResult has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var saveTestResult = Meteor.bindEnvironment(function saveTestResult(test) {
            var result = {
              id: 'jasmine:' + self.mode + ' | ' + test.id,
              //async: test.async,
              framework: options.framework,
      Severity: Minor
      Found in packages/meteor-jasmine/src/lib/VelocityTestReporter.js - About 1 hr to fix

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

          generateMocks: _.once(function () {
        
            /*
             Package = {
             "meteor": {
        Severity: Minor
        Found in packages/meteor-jasmine/src/server/unit/mock-generator.js - About 1 hr to fix

          Function createMirrorIframe has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            createMirrorIframe: function () {
              var self = this
              var iframeId = 'jasmine-mirror'
          
              var getMirrorUrl = function (mirrorInfo) {

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

                var islib_b = (b.indexOf(path.sep + 'lib' + path.sep) !== -1 ||
                               b.indexOf('lib' + path.sep) === 0)
            Severity: Major
            Found in packages/meteor-jasmine/src/server/lib/load-order-sort.js and 1 other location - About 1 hr to fix
            packages/meteor-jasmine/src/server/lib/load-order-sort.js on lines 46..47

            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

                var islib_a = (a.indexOf(path.sep + 'lib' + path.sep) !== -1 ||
                               a.indexOf('lib' + path.sep) === 0)
            Severity: Major
            Found in packages/meteor-jasmine/src/server/lib/load-order-sort.js and 1 other location - About 1 hr to fix
            packages/meteor-jasmine/src/server/lib/load-order-sort.js on lines 48..49

            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

            Function loadFixtureIntoCache_ has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              jasmine.Fixtures.prototype.loadFixtureIntoCache_ = function (relativeUrl) {
                var self = this
                  , url = this.makeFixtureUrl_(relativeUrl)
                  , htmlText = ''
                  , request = $.ajax({
            Severity: Minor
            Found in packages/meteor-jasmine/src/client/unit/assets/jasmine-jquery.js - About 1 hr to fix

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

                  return _.chain(WebApp.clientPrograms['web.browser'].manifest)
                    .filter(function (file) {
                      return file.path.indexOf('packages/') !== 0
                    })
                    .forEach(function (file) {
              packages/meteor-jasmine/src/client/unit/ClientUnitTestFramework.js on lines 213..223

              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

                  _.chain(WebApp.clientPrograms['web.browser'].manifest)
                    .filter(function (file) {
                      return file.path.indexOf('packages/') === 0
                    })
                    .filter(function (file) {
              packages/meteor-jasmine/src/client/unit/ClientUnitTestFramework.js on lines 241..247

              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

              Function getFiles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function getFiles(options) {
                options = _.extend({
                  ignoreDirs: []
                }, options)
              
              
              Severity: Minor
              Found in packages/meteor-jasmine/src/server/lib/file-loader.js - About 1 hr to fix

                Function loadFixtureIntoCache_ has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    jasmine.Fixtures.prototype.loadFixtureIntoCache_ = function (relativeUrl) {
                      var self = this
                        , url = this.makeFixtureUrl_(relativeUrl)
                        , htmlText = ''
                        , request = $.ajax({

                  Function spyOn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      spyOn: function (selector, eventName) {
                        var handler = function (e) {
                          var calls = (typeof data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)] !== 'undefined') ? data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)].calls : 0
                          data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)] = {
                            args: jasmine.util.argsToArray(arguments),
                  Severity: Minor
                  Found in packages/meteor-jasmine/src/client/unit/assets/jasmine-jquery.js - About 1 hr to fix

                    Function spyOn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          spyOn: function (selector, eventName) {
                            var handler = function (e) {
                              var calls = (typeof data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)] !== 'undefined') ? data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)].calls : 0
                              data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)] = {
                                args: jasmine.util.argsToArray(arguments),

                      Function mock has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var mock = function (object, propertyName, options) {
                          if (typeof object !== 'object' && typeof object !== 'function') {
                            throw new Error('object must be an object')
                          }
                          if (typeof propertyName !== 'string') {
                      Severity: Minor
                      Found in packages/meteor-jasmine/src/lib/mock.js - About 1 hr to fix

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

                        App.icons({
                          // iOS
                          'iphone': 'resources/icons/icon-60x60.png',
                          'iphone_2x': 'resources/icons/icon-60x60@2x.png',
                          'ipad': 'resources/icons/icon-72x72.png',
                        Severity: Major
                        Found in mobile-config.js and 1 other location - About 1 hr to fix
                        packages/meteor-jasmine/test-app/mobile-config.js on lines 10..22

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

                        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

                        App.icons({
                          // iOS
                          'iphone': 'resources/icons/icon-60x60.png',
                          'iphone_2x': 'resources/icons/icon-60x60@2x.png',
                          'ipad': 'resources/icons/icon-72x72.png',
                        Severity: Major
                        Found in packages/meteor-jasmine/test-app/mobile-config.js and 1 other location - About 1 hr to fix
                        mobile-config.js on lines 10..22

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

                        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