Vizzuality/landgriffon

View on GitHub
cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts

Summary

Maintainability
F
1 wk
Test Coverage

File FlowMapSelectors.ts has 1034 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright 2022 FlowmapBlue
 * Copyright 2018-2020 Teralytics, modified by FlowmapBlue
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
Severity: Major
Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 2 days to fix

    FlowMapSelectors has 66 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class FlowMapSelectors<L, F> {
      accessors: FlowMapAggregateAccessors<L, F>;
    
      constructor(accessors: FlowMapDataAccessors<L, F>) {
        this.accessors = new FlowMapAggregateAccessors(accessors);
    Severity: Major
    Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 1 day to fix

      Function prepareLayersData has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        prepareLayersData(state: FlowMapState, props: FlowMapData<L, F>): LayersData {
          const locations = this.getLocationsForFlowMapLayer(state, props) || [];
          const flows = this.getFlowsForFlowMapLayer(state, props) || [];
          const { getFlowOriginId, getFlowDestId, getFlowMagnitude, getLocationId, getLocationCentroid } =
            this.accessors;
      Severity: Major
      Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 3 hrs to fix

        Function calcLocationTotalsExtent has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function calcLocationTotalsExtent(
          locationTotals: Map<string, LocationTotals> | undefined,
          locationIdsInViewport: Set<string> | undefined,
        ) {
          if (!locationTotals) return undefined;
        Severity: Minor
        Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - 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 getFlowLineAttributesByIndex has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function getFlowLineAttributesByIndex(
          lineAttributes: FlowLinesLayerAttributes,
          index: number,
        ): FlowLinesLayerAttributes {
          const {
        Severity: Minor
        Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 1 hr to fix

          Function prepareLayersData has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            prepareLayersData(state: FlowMapState, props: FlowMapData<L, F>): LayersData {
              const locations = this.getLocationsForFlowMapLayer(state, props) || [];
              const flows = this.getFlowsForFlowMapLayer(state, props) || [];
              const { getFlowOriginId, getFlowDestId, getFlowMagnitude, getLocationId, getLocationCentroid } =
                this.accessors;
          Severity: Minor
          Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - 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 aggregateFlows has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function aggregateFlows<F>(flows: F[], flowAccessors: FlowAccessors<F>): AggregateFlow[] {
            // Sum up flows with same origin, dest
            const byOriginDest = nest<F, AggregateFlow>()
              .key(flowAccessors.getFlowOriginId)
              .key(flowAccessors.getFlowDestId)
          Severity: Minor
          Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - 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 aggregateFlows has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function aggregateFlows<F>(flows: F[], flowAccessors: FlowAccessors<F>): AggregateFlow[] {
            // Sum up flows with same origin, dest
            const byOriginDest = nest<F, AggregateFlow>()
              .key(flowAccessors.getFlowOriginId)
              .key(flowAccessors.getFlowDestId)
          Severity: Minor
          Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 1 hr to fix

            Function getFlowMagnitudeExtent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              getFlowMagnitudeExtent(
                state: FlowMapState,
                props: FlowMapData<L, F>,
              ): [number, number] | undefined {
                if (state.settingsState.adaptiveScalesEnabled) {
            Severity: Minor
            Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 55 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

            Avoid too many return statements within this function.
            Open

                    return true;
            Severity: Major
            Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts - About 30 mins to fix

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

              function latY(lat: number) {
                const sin = Math.sin((lat * Math.PI) / 180);
                const y = 0.5 - (0.25 * Math.log((1 + sin) / (1 - sin))) / Math.PI;
                return y < 0 ? 0 : y > 1 ? 1 : y;
              }
              Severity: Major
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 3 hrs to fix
              cookie-traceability/src/lib/flowmap/data/cluster/cluster.ts on lines 273..277

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

              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 outCircleRadii = new Float32Array(
                    locations.map((loc) => {
                      const id = getLocationId(loc);
                      return locationIdsInViewport?.has(id) ? getOutCircleSize(id) : 1.0;
                    }),
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 954..959

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

              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 inCircleRadii = new Float32Array(
                    locations.map((loc) => {
                      const id = getLocationId(loc);
                      return locationIdsInViewport?.has(id) ? getInCircleSize(id) : 1.0;
                    }),
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 960..965

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

              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

                getFadeEnabled: Selector<L, F, boolean> = (state: FlowMapState, props: FlowMapData<L, F>) =>
                  state.settingsState.fadeEnabled;
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 109..110
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 118..119

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

              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

                getAnimate: Selector<L, F, boolean> = (state: FlowMapState, props: FlowMapData<L, F>) =>
                  state.settingsState.animationEnabled;
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 109..110
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 112..113

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

              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

                getDarkMode: Selector<L, F, boolean> = (state: FlowMapState, props: FlowMapData<L, F>) =>
                  state.settingsState.darkMode;
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 112..113
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 118..119

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

              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

                      (location: L | ClusterNode) =>
                        latY(
                          isLocationClusterNode(location)
                            ? location.centroid[1]
                            : this.accessors.getLocationCentroid(location)[1],
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 55 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 657..662

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

              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

                      (location: L | ClusterNode) =>
                        lngX(
                          isLocationClusterNode(location)
                            ? location.centroid[0]
                            : this.accessors.getLocationCentroid(location)[0],
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 55 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 663..668

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

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

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

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

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

              Refactorings

              Further Reading

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

                  return scaleSqrt()
                    .range([0, maxLocationCircleSize])
                    .domain([
                      0,
                      // should support diff mode too
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 50 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 811..820

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 51.

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

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

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

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

              Refactorings

              Further Reading

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

                  return scaleLinear()
                    .range([0.025, 0.5])
                    .domain([
                      0,
                      // should support diff mode too
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 50 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 832..841

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 51.

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

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

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

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

              Refactorings

              Further Reading

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

                    if (!rv) {
                      rv = [lo, hi];
                    } else {
                      if (lo < rv[0]) rv[0] = lo;
                      if (hi > rv[1]) rv[1] = hi;
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 45 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 516..521

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 50.

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

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

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

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

              Refactorings

              Further Reading

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

                        if (rv == null) {
                          rv = [count, count];
                        } else {
                          if (count < rv[0]) rv[0] = count;
                          if (count > rv[1]) rv[1] = count;
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 45 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 1106..1111

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 50.

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

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

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

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

              Refactorings

              Further Reading

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

                      if (!ids.has(this.accessors.getFlowDestId(flow)))
                        missing.add(this.accessors.getFlowDestId(flow));
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 40 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 461..462

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

              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 (!ids.has(this.accessors.getFlowOriginId(flow)))
                        missing.add(this.accessors.getFlowOriginId(flow));
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 40 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 463..464

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

              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

                getOutCircleSizeGetter = createSelector(
                  this.getCircleSizeScale,
                  this.getLocationTotals,
                  (circleSizeScale, locationTotals) => {
                    return (locationId: string) => {
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 35 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 844..856

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

              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

                      aggregated.sort((a, b) =>
                        descending(
                          Math.abs(this.accessors.getFlowMagnitude(a)),
                          Math.abs(this.accessors.getFlowMagnitude(b)),
                        ),
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 35 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 171..175

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

              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

                      .sort((a: F, b: F) =>
                        descending(
                          Math.abs(this.accessors.getFlowMagnitude(a)),
                          Math.abs(this.accessors.getFlowMagnitude(b)),
                        ),
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 35 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 493..497

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

              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

                getInCircleSizeGetter = createSelector(
                  this.getCircleSizeScale,
                  this.getLocationTotals,
                  (circleSizeScale, locationTotals) => {
                    return (locationId: string) => {
              Severity: Minor
              Found in cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts and 1 other location - About 35 mins to fix
              cookie-traceability/src/lib/flowmap/data/FlowMapSelectors.ts on lines 858..870

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

              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

              There are no issues that match your filters.

              Category
              Status