katrotz/splitify

View on GitHub

Showing 98 of 98 total issues

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

    sampleTestGenerator: function () {
      return [
        {
          path: 'jasmine/client/integration/sample/spec/PlayerSpec.js',
          contents: Assets.getText('src/client/integration/sample-tests/sample/spec/PlayerSpec.js')
packages/meteor-jasmine/src/client/unit/ClientUnitTestFramework.js on lines 13..32
packages/meteor-jasmine/src/server/integration/ServerIntegrationTestFramework.js on lines 78..97
packages/meteor-jasmine/src/server/unit/ServerUnitTestFramework.js on lines 16..35

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

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

    sampleTestGenerator: function () {
      return [
        {
          path: 'jasmine/client/unit/sample/spec/PlayerSpec.js',
          contents: Assets.getText('src/client/unit/sample-tests/sample/spec/PlayerSpec.js')
packages/meteor-jasmine/src/client/integration/ClientIntegrationTestFramework.js on lines 9..28
packages/meteor-jasmine/src/server/integration/ServerIntegrationTestFramework.js on lines 78..97
packages/meteor-jasmine/src/server/unit/ServerUnitTestFramework.js on lines 16..35

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

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

    sampleTestGenerator: function () {
      return [
        {
          path: 'jasmine/server/integration/sample/spec/PlayerSpec.js',
          contents: Assets.getText('src/server/integration/sample-tests/sample/spec/PlayerSpec.js')
packages/meteor-jasmine/src/client/integration/ClientIntegrationTestFramework.js on lines 9..28
packages/meteor-jasmine/src/client/unit/ClientUnitTestFramework.js on lines 13..32
packages/meteor-jasmine/src/server/unit/ServerUnitTestFramework.js on lines 16..35

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

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.launchScreens({
  // iOS
  'iphone': 'resources/splash/splash-320x480.png',
  'iphone_2x': 'resources/splash/splash-320x480@2x.png',
  'iphone5': 'resources/splash/splash-320x568@2x.png',
Severity: Major
Found in mobile-config.js and 1 other location - About 2 hrs to fix
packages/meteor-jasmine/test-app/mobile-config.js on lines 24..43

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

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

App.launchScreens({
  // iOS
  'iphone': 'resources/splash/splash-320x480.png',
  'iphone_2x': 'resources/splash/splash-320x480@2x.png',
  'iphone5': 'resources/splash/splash-320x568@2x.png',
Severity: Major
Found in packages/meteor-jasmine/test-app/mobile-config.js and 1 other location - About 2 hrs to fix
mobile-config.js on lines 24..43

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

Function getKarmaConfig has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getKarmaConfig: function () {
    var files = [];
    var proxies = {};

    this._addPreAppFiles(files, proxies)
Severity: Major
Found in packages/meteor-jasmine/src/client/unit/ClientUnitTestFramework.js - About 2 hrs to fix

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

    beforeEach(function () {
      jasmine.addMatchers({
        toBePlaying: function () {
          return {
            compare: function (actual, expected) {
    packages/meteor-jasmine/src/client/integration/sample-tests/sample/spec/SpecMatchers.js on lines 1..15
    packages/meteor-jasmine/src/client/unit/sample-tests/sample/spec/SpecMatchers.js on lines 1..15
    packages/meteor-jasmine/src/server/unit/sample-tests/sample/spec/SpecMatchers.js on lines 1..15

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

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

    beforeEach(function () {
      jasmine.addMatchers({
        toBePlaying: function () {
          return {
            compare: function (actual, expected) {
    packages/meteor-jasmine/src/client/integration/sample-tests/sample/spec/SpecMatchers.js on lines 1..15
    packages/meteor-jasmine/src/server/integration/sample-tests/sample/spec/SpecMatchers.js on lines 1..15
    packages/meteor-jasmine/src/server/unit/sample-tests/sample/spec/SpecMatchers.js on lines 1..15

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

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

    beforeEach(function () {
      jasmine.addMatchers({
        toBePlaying: function () {
          return {
            compare: function (actual, expected) {
    packages/meteor-jasmine/src/client/unit/sample-tests/sample/spec/SpecMatchers.js on lines 1..15
    packages/meteor-jasmine/src/server/integration/sample-tests/sample/spec/SpecMatchers.js on lines 1..15
    packages/meteor-jasmine/src/server/unit/sample-tests/sample/spec/SpecMatchers.js on lines 1..15

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

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

    beforeEach(function () {
      jasmine.addMatchers({
        toBePlaying: function () {
          return {
            compare: function (actual, expected) {
    packages/meteor-jasmine/src/client/integration/sample-tests/sample/spec/SpecMatchers.js on lines 1..15
    packages/meteor-jasmine/src/client/unit/sample-tests/sample/spec/SpecMatchers.js on lines 1..15
    packages/meteor-jasmine/src/server/integration/sample-tests/sample/spec/SpecMatchers.js on lines 1..15

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

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

        this.specDone = function (specResult) {
          var skipped = specResult.status === 'disabled' || specResult.status === 'pending';
          var time = skipped ? 0 : new Date().getTime() - specResult.startTime
    
          var velocitySpecDone = function (callback) {
    Severity: Major
    Found in packages/meteor-jasmine/src/client/unit/assets/adapter.js - About 2 hrs to fix

      Function formatMessage has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function formatMessage(messages) {
            var out = '';
            var already = {};
            var indent = '';
      
      
      Severity: Major
      Found in packages/meteor-jasmine/src/lib/VelocityTestReporter.js - About 2 hrs to fix

        File ClientUnitTestFramework.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* globals ClientUnitTestFramework: true, __meteor_runtime_config__: false */
        
        var path = Npm.require('path');
        var fs = Npm.require('fs');
        var mkdirp = Npm.require('mkdirp');
        Severity: Minor
        Found in packages/meteor-jasmine/src/client/unit/ClientUnitTestFramework.js - About 2 hrs to fix

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

            if (process.env.JASMINE_SERVER_UNIT === '1' && !isTestPackagesMode()) {
              frameworks.serverUnit = new ServerUnitTestFramework()
          
              if (isMainApp()) {
                frameworks.serverUnit.registerWithVelocity()
          Severity: Major
          Found in packages/meteor-jasmine/src/registerFrameworks.js and 1 other location - About 1 hr to fix
          packages/meteor-jasmine/src/registerFrameworks.js on lines 65..74

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

          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

            if (process.env.JASMINE_CLIENT_UNIT !== '0' && !isTestPackagesMode()) {
              frameworks.clientUnit = new ClientUnitTestFramework()
          
              if (isMainApp()) {
                frameworks.clientUnit.registerWithVelocity()
          Severity: Major
          Found in packages/meteor-jasmine/src/registerFrameworks.js and 1 other location - About 1 hr to fix
          packages/meteor-jasmine/src/registerFrameworks.js on lines 78..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 72.

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

          function getFiles(dir, matcher) {
            var allFiles = []
            var stat;
          
            try {
          Severity: Minor
          Found in packages/meteor-jasmine/src/server/lib/get-files.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

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

            it('first async passes', function (done) {
              expect(done).toBeDefined();
              setTimeout(Meteor.bindEnvironment(function () {
                expect(true).toBe(true)
                done()
          packages/meteor-jasmine/test-app/tests/jasmine/server/integration/async-spec.js on lines 10..16

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

          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('second async passes', function (done) {
              expect(done).toBeDefined();
              setTimeout(Meteor.bindEnvironment(function () {
                expect(true).toBe(true)
                done()
          packages/meteor-jasmine/test-app/tests/jasmine/server/integration/async-spec.js on lines 2..8

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

          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

            it('runs in the Meteor fiber', function () {
              var callMeteorMethod = function () {
                expect(Meteor.call('test', 1)).toBe(true)
              }
              expect(callMeteorMethod).not.toThrow()
          packages/meteor-jasmine/test-app/tests/jasmine/server/integration/sample-spec.js on lines 8..13

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

          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

            it('runs in the Meteor fiber', function () {
              var callMeteorMethod = function () {
                expect(Meteor.call('test', 1)).toBe(true)
              }
              expect(callMeteorMethod).not.toThrow()
          packages/meteor-jasmine/test-app/tests/jasmine/server/integration/sample2-spec.js on lines 5..10

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

          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