Codibre/fluent-iterable

View on GitHub

Showing 7 of 90 total issues

File flat-join-function.ts has 263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  tail,
  head,
  AsyncItemOrSelfType,
  FluentAsyncIterable,
Severity: Minor
Found in src/types/function-types/flat-join-function.ts - About 2 hrs to fix

    Function getStatsStepper has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function getStatsStepper() {
      const avgStepper = getAverageStepper();
      const minMaxStepper = getMinMaxStepper();
      let variance: number | undefined;
      let lastVarianceCount = 0;
    Severity: Minor
    Found in src/utils/get-stats-stepper.ts - About 1 hr to fix

      Function getGroupingTopHit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function getGroupingTopHit<K, T, NewT = T>(
        distinct: AnyMapper<T> | Choose<NewT>,
        choose?: Choose<NewT>,
        mapper: Mapper<T, NewT> | keyof T = identity as any,
      ): KVGroupTransform<K, T, NewT> {
      Severity: Minor
      Found in src/utils/get-grouping-top-hit.ts - About 1 hr to fix

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

        export function distinctRecipe(ingredients: DistinctIngredients) {
          const ordered = orderedDistinctRecipe(ingredients);
          const choose = chooseDistinctRecipe(ingredients);
          const { filterOrAll, resolver } = ingredients;
        
        
        Severity: Minor
        Found in src/recipes/distinct-recipe.ts - About 1 hr to fix

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

          export function groupRecipe(ingredients: GroupIngredients) {
            const orderedGroup = orderedGroupRecipe(ingredients);
            const { reduceAndMap, resolver, iterate, forEach } = ingredients;
            return function <T>(
              this: AnyIterable<T>,
          Severity: Minor
          Found in src/recipes/group-recipe.ts - About 1 hr to fix

            Function distinct has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              return function distinct<T>(
                this: AnyIterable<T>,
                mappers: FunctionAnyMapper<any>[],
              ) {
                const { length } = mappers;
            Severity: Minor
            Found in src/recipes/distinct-by-recipe.ts - About 1 hr to fix

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

              export function distinctRecipe(ingredients: DistinctIngredients) {
                const ordered = orderedDistinctRecipe(ingredients);
                const choose = chooseDistinctRecipe(ingredients);
                const { filterOrAll, resolver } = ingredients;
              
              
              Severity: Minor
              Found in src/recipes/distinct-recipe.ts - 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

              Severity
              Category
              Status
              Source
              Language