Fluxlet/fluxlet

View on GitHub

Showing 24 of 24 total issues

Function createFluxlet has 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createFluxlet(id) {

  const uid = nextUID++

  // The state of the fluxlet between dispatches
Severity: Major
Found in src/fluxlet.js - About 4 hrs to fix

    Function exports has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function () {
    
      // Preprocessor to transpile imports/exports and possibly other ES6 elements
      var babelPreprocessor = file => require('babel')
                                        .transform(file.content, {sourceMap: true})
    Severity: Minor
    Found in wallaby.js - About 2 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 exports has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function () {
    
      // Preprocessor to transpile imports/exports and possibly other ES6 elements
      var babelPreprocessor = file => require('babel')
                                        .transform(file.content, {sourceMap: true})
    Severity: Major
    Found in wallaby.js - About 2 hrs to fix

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

      export const sideEffects = {
        sideEffect({ logId, name, enable }) {
          enable && logger.log(`${prefix(logId)}sideEffect ${name}`)
        }
      }
      Severity: Major
      Found in src/logging.js and 1 other location - About 1 hr to fix
      src/logging.js on lines 95..99

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

      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

      export const calculations = {
        calculation({ logId, name, enable }) {
          enable && logger.log(`${prefix(logId)}calculation ${name}`)
        }
      }
      Severity: Major
      Found in src/logging.js and 1 other location - About 1 hr to fix
      src/logging.js on lines 101..105

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 68.

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

        function createDispatcher(actionName, action) {
          // This is the dispatcher function, created for the given action.
          // It args are passed through to the action function later.
          return (...actionArgs) => {
      
      
      Severity: Minor
      Found in src/fluxlet.js - About 1 hr to fix

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

          registerCalculations({ logId, fluxlet }) {
            return (namedCalculations) => {
              // Check that we aren't registering calculations with the same names
              checkForDuplicates(namedCalculations, fluxlet.has.calculation,
                (name) => `Attempt to add an existing calculation '${name}' to ${logId}`)
        Severity: Major
        Found in src/dedupe.js and 2 other locations - About 1 hr to fix
        src/dedupe.js on lines 9..15
        src/dedupe.js on lines 25..31

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

        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

          registerActions({ logId, fluxlet }) {
            return (namedActions) => {
              // Check that we aren't registering actions with the same names
              checkForDuplicates(namedActions, fluxlet.has.action,
                (name) => `Attempt to add an existing action '${name}' to ${logId}`)
        Severity: Major
        Found in src/dedupe.js and 2 other locations - About 1 hr to fix
        src/dedupe.js on lines 17..23
        src/dedupe.js on lines 25..31

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

        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

          registerSideEffects({ logId, fluxlet }) {
            return (namedSideEffects) => {
              // Check that we aren't registering side effects with the same names
              checkForDuplicates(namedSideEffects, fluxlet.has.sideEffect,
                (name) => `Attempt to add an existing side-effect '${name}' to ${logId}`)
        Severity: Major
        Found in src/dedupe.js and 2 other locations - About 1 hr to fix
        src/dedupe.js on lines 9..15
        src/dedupe.js on lines 17..23

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

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

        function createFluxlet(id) {
        
          const uid = nextUID++
        
          // The state of the fluxlet between dispatches
        Severity: Minor
        Found in src/fluxlet.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 bootstrap has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            bootstrap: function (wallaby) {
              // Polyfill bind for PhantomJS 1.x
              if (!Function.prototype.bind) {
                Function.prototype.bind = function(oThis) {
                  if (typeof this !== 'function') {
        Severity: Minor
        Found in wallaby.js - About 1 hr to fix

          Function dispatch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            dispatch({ logId, actionName, actionArgs, startState, enable }) {
              if (enable) {
                if (collapsed) {
                  (logger.groupCollapsed || logger.group || logger.log).call(logger, `${logId} dispatch ${actionName}`)
                } else {
          Severity: Minor
          Found in src/logging.js - About 35 mins 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

            actions(...namedActions: Array<Named<Action<S>>>): Fluxlet<S,D>
          Severity: Minor
          Found in src/fluxlet.d.ts and 1 other location - About 35 mins to fix
          src/fluxlet.d.ts on lines 21..21

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

          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

            calculations(...namedCalculations: Array<Named<Calculation<S>>>): Fluxlet<S,D>
          Severity: Minor
          Found in src/fluxlet.d.ts and 1 other location - About 35 mins to fix
          src/fluxlet.d.ts on lines 19..19

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

          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

          Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
          Open

          export default {
          Severity: Minor
          Found in src/validate-registrations.js by eslint

          For more information visit Source: http://eslint.org/docs/rules/

          Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
          Open

          export const gather = {
          Severity: Minor
          Found in src/backdoor.js by eslint

          For more information visit Source: http://eslint.org/docs/rules/

          Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
          Open

          export default {
          Severity: Minor
          Found in src/dedupe.js by eslint

          For more information visit Source: http://eslint.org/docs/rules/

          Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
          Open

          import createRegister from "./register"
          Severity: Minor
          Found in src/fluxlet.js by eslint

          For more information visit Source: http://eslint.org/docs/rules/

          Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
          Open

          export default {
          Severity: Minor
          Found in src/lockdown.js by eslint

          For more information visit Source: http://eslint.org/docs/rules/

          Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
          Open

          export default function() {
          Severity: Minor
          Found in src/register.js by eslint

          For more information visit Source: http://eslint.org/docs/rules/

          Severity
          Category
          Status
          Source
          Language