soldotno/aurora-core

View on GitHub

Showing 41 of 41 total issues

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

describe('resolveVisibility (include)', () => {
  describe('.onServer()', () => {
    it('should resolve visibility recursively on the server (hide every module with visibility set)', (done) => {
      /**
       * Import the unit we want to test
Severity: Major
Found in src/utils/resolve-visibility.test.server.js and 1 other location - About 6 days to fix
src/utils/resolve-visibility.test.server.js on lines 335..583

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

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('resolveVisibility (exclude)', () => {
  describe('.onServer()', () => {
    it('should resolve visibility recursively on the server (hide every module with visibility set)', (done) => {
      /**
       * Import the unit we want to test
Severity: Major
Found in src/utils/resolve-visibility.test.server.js and 1 other location - About 6 days to fix
src/utils/resolve-visibility.test.server.js on lines 82..330

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

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 index.test.client.js has 799 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import expect from 'expect';
import rootReducer from './index.js';

describe('rootReducer()', () => {
  describe('REFRESH_CONFIG', () => {
Severity: Major
Found in src/reducers/index.test.client.js - About 1 day to fix

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

        it('should handle an error of resetting the config correctly', () => {
          const initialConfig = {
            app: {
              type: 'demo-app',
              options: {
    Severity: Major
    Found in src/reducers/index.test.client.js and 1 other location - About 1 day to fix
    src/reducers/index.test.client.js on lines 184..258

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

    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 handle an error of resetting the config correctly', () => {
          const initialConfig = {
            app: {
              type: 'demo-app',
              options: {
    Severity: Major
    Found in src/reducers/index.test.client.js and 1 other location - About 1 day to fix
    src/reducers/index.test.client.js on lines 769..843

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

    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 resolve-visibility.test.server.js has 673 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Dependencies
     */
    import expect from 'expect';
    import mockery from 'mockery';
    Severity: Major
    Found in src/utils/resolve-visibility.test.server.js - About 1 day to fix

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

            expect(finalState).toEqual({
              error: null,
              version: '12345',
              config: {
                app: {
      Severity: Major
      Found in src/reducers/index.test.client.js and 1 other location - About 1 day to fix
      src/reducers/index.test.client.js on lines 708..766

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

      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

            expect(finalState).toEqual({
              error: null,
              version: '12345',
              config: {
                app: {
      Severity: Major
      Found in src/reducers/index.test.client.js and 1 other location - About 1 day to fix
      src/reducers/index.test.client.js on lines 424..482

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

      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

          const paginationQuery = removeFalsyKeysFromObject({
            page: !isUndefined(req.query.page) ? +req.query.page : null,
            perPage: !isUndefined(req.query.perPage) ? +req.query.perPage : null,
            initialLimit: !isUndefined(req.query.initialLimit) ? +req.query.initialLimit : null,
            hasMore: !isUndefined(req.query.hasMore) ? +req.query.hasMore : null,
      Severity: Major
      Found in src/render/server.js and 1 other location - About 5 hrs to fix
      src/render/server.js on lines 77..82

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

      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

          const paginationQuery = removeFalsyKeysFromObject({
            page: !isUndefined(req.query.page) ? +req.query.page : null,
            perPage: !isUndefined(req.query.perPage) ? +req.query.perPage : null,
            initialLimit: !isUndefined(req.query.initialLimit) ? +req.query.initialLimit : null,
            hasMore: !isUndefined(req.query.hasMore) ? +req.query.hasMore : null,
      Severity: Major
      Found in src/render/server.js and 1 other location - About 5 hrs to fix
      src/render/server.js on lines 57..62

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

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

        function renderServerInternal(req, res, next) {
          // Extract the pagination data from the query
          const paginationQuery = removeFalsyKeysFromObject({
            page: !isUndefined(req.query.page) ? +req.query.page : null,
            perPage: !isUndefined(req.query.perPage) ? +req.query.perPage : null,
      Severity: Major
      Found in src/render/server.js - About 4 hrs to fix

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

        const isVisibleMockSmall = function(settings = {}, query = {}, visibility = {}) {
          /**
           * Destructure visibility
           */
          const {
        Severity: Major
        Found in src/utils/resolve-visibility.test.server.js and 1 other location - About 4 hrs to fix
        src/utils/resolve-visibility.test.server.js on lines 59..77

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

        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

        const isVisibleMockLarge = function(settings = {}, query = {}, visibility = {}) {
          /**
           * Destructure visibility
           */
          const {
        Severity: Major
        Found in src/utils/resolve-visibility.test.server.js and 1 other location - About 4 hrs to fix
        src/utils/resolve-visibility.test.server.js on lines 36..54

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

        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

              const nextConfig = {
                app: {
                  type: 'demo-app',
                  options: {
                    modules: [{
        Severity: Major
        Found in src/reducers/index.test.client.js and 1 other location - About 3 hrs to fix
        src/reducers/index.test.client.js on lines 649..680

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

        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

              const nextConfig = {
                app: {
                  type: 'demo-app',
                  options: {
                    modules: [{
        Severity: Major
        Found in src/reducers/index.test.client.js and 1 other location - About 3 hrs to fix
        src/reducers/index.test.client.js on lines 365..396

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

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

        export default function renderServer({
          cacheHTML = {
            get: () => Promise.reject('No cacheHTML.get method supplied to constructor'),
            set: () => console.warn('No cacheHTML.set method supplied to constructor, skipping cache creation'),
            addNonCachableHTML: () => console.warn('No cacheHTML.addNonCachableHTML supplied to constructor, no non-cached html will be appened.'),
        Severity: Minor
        Found in src/render/server.js - About 3 hrs 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 withDataDecorator has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          return function withDataDecorator(Component) {
            class WithData extends React.Component {
              // Add a specific display name
              static displayName = `${getDisplayName(Component)}WithData`;
        
        
        Severity: Major
        Found in src/decorators/with-data.js - About 3 hrs to fix

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

                expect(finalState).toEqual({
                  error: null,
                  version: '12345',
                  config: nextConfig,
                  settings: {
          Severity: Major
          Found in src/reducers/index.test.client.js and 1 other location - About 2 hrs to fix
          src/reducers/index.test.client.js on lines 316..332

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

          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

                expect(finalState).toEqual({
                  error: null,
                  version: 'latest',
                  config: initialConfig,
                  settings: {
          Severity: Major
          Found in src/reducers/index.test.client.js and 1 other location - About 2 hrs to fix
          src/reducers/index.test.client.js on lines 165..181

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

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

          export default function rootReducer(state, action) {
            switch (action.type) {
              case REPLACE_STATE:
                return Object.assign({}, state, action.state);
          
          
          Severity: Major
          Found in src/reducers/index.js - About 2 hrs to fix
            Severity
            Category
            Status
            Source
            Language