Showing 92 of 92 total issues

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

      if (Object.prototype.isPrototypeOf.call(y, p) !== Object.prototype.isPrototypeOf.call(x, p)) {
        return false
      } else if (typeof y[p] !== typeof x[p]) {
        return false
      }
Severity: Major
Found in src/object/equals.ts and 1 other location - About 2 hrs to fix
src/object/equals.ts on lines 76..80

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

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

Consider simplifying this complex logical expression.
Open

    if (
      (typeof x === 'function' && typeof y === 'function') ||
      (x instanceof Date && y instanceof Date) ||
      (x instanceof RegExp && y instanceof RegExp) ||
      (x instanceof String && y instanceof String) ||
Severity: Critical
Found in src/object/equals.ts - About 2 hrs to fix

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

          if (Object.prototype.isPrototypeOf.call(y, p) !== Object.prototype.isPrototypeOf.call(x, p)) {
            return false
          } else if (typeof y[p] !== typeof x[p]) {
            return false
          }
    Severity: Major
    Found in src/object/equals.ts and 1 other location - About 2 hrs to fix
    src/object/equals.ts on lines 68..72

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

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

    export default function match(expr: any, cases: casesType, options?: matchOptions): any {
      const opt = {
        strict: true,
        ...(isObject(options) ? options : {}),
      }
    Severity: Minor
    Found in src/core/match.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

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

    typedArrayTags[float32Tag] =
      typedArrayTags[float64Tag] =
      typedArrayTags[int8Tag] =
      typedArrayTags[int16Tag] =
      typedArrayTags[int32Tag] =
    Severity: Major
    Found in src/internal/base/baseIsTypedArray.ts and 1 other location - About 1 hr to fix
    src/internal/base/baseIsTypedArray.ts on lines 53..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 73.

    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

      typedArrayTags[errorTag] =
      typedArrayTags[funcTag] =
      typedArrayTags[mapTag] =
      typedArrayTags[numberTag] =
      typedArrayTags[objectTag] =
    Severity: Major
    Found in src/internal/base/baseIsTypedArray.ts and 1 other location - About 1 hr to fix
    src/internal/base/baseIsTypedArray.ts on lines 36..45

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

    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 function isBlobs(...parameters: any[]): boolean {
      if (parameters.length === 0) {
        throw new Error('Please provide at least one number to evaluate isBlob.')
      }
    
    
    Severity: Major
    Found in src/is/isBlob.ts and 1 other location - About 1 hr to fix
    src/is/isNil.ts on lines 4..10

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 71.

    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 function isNulls(...parameters: any[]): boolean {
      if (parameters.length === 0) {
        throw new Error('Please provide at least one param to evaluate isNull.')
      }
    
    
    Severity: Major
    Found in src/is/isNil.ts and 1 other location - About 1 hr to fix
    src/is/isBlob.ts on lines 4..10

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 71.

    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 function isArrays(...parameters: any[]): boolean {
      if (parameters.length === 0) {
        throw new Error('Please provide at least one param to evaluate isArray.')
      }
    
    
    Severity: Major
    Found in src/is/isArray.ts and 1 other location - About 1 hr to fix
    src/is/isNil.ts on lines 12..18

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

    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 function isNils(...parameters: any[]): boolean {
      if (parameters.length === 0) {
        throw new Error('Please provide at least one param to evaluate isNull.')
      }
    
    
    Severity: Major
    Found in src/is/isNil.ts and 1 other location - About 1 hr to fix
    src/is/isArray.ts on lines 8..14

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

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

    export default function arrayLikeKeys(value: any, inherited: boolean = false): string[] {
      const isArray_ = Array.isArray(value),
        isArgument = !isArray_ && isArguments(value),
        isBuff = !isArray_ && !isArgument && isBuffer(value),
        isType = !isArray_ && !isArgument && !isBuff && isTypedArray(value),
    Severity: Minor
    Found in src/internal/arrayLikeKeys.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 toQueryObjects has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function toQueryObjects(
      name: string,
      value: oType | oTypeArray,
      recursive: boolean = false
    ): Record<string, any>[] {
    Severity: Minor
    Found in src/object/toQueryObjects.ts - About 1 hr to fix

      Function clone has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function clone<T = NonNullable<any>>(item: T, cloneDom: boolean = true): T {
        if (item === null || item === undefined) {
          return item
        }
      
      
      Severity: Minor
      Found in src/core/clone.ts - About 1 hr to fix

        Function main has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        async function main(): Promise<void> {
          for await (const entry of readdirP(path.relative(process.cwd(), path.join(__dirname, '..', 'dist/esm')))) {
            const match = /^(.*)(\.(js|js\.map|d\.ts))$/.exec(entry)
            if (match == null) {
              continue
        Severity: Minor
        Found in .scripts/rename.ts - About 1 hr to fix

          Function removeEmpty has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function removeEmpty(object: Record<PropertyKey, any>): Record<PropertyKey, any> {
            let result: Record<PropertyKey, any> = {},
              key: PropertyKey
          
            for (key in object) {
          Severity: Minor
          Found in src/object/removeEmpty.ts - About 1 hr to fix

            Function equals has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function equals(array1: any[], array2: any[]): boolean {
              const length1 = array1.length
              const length2 = array2.length
              let i
            
            
            Severity: Minor
            Found in src/array/equals.ts - About 1 hr to fix

              Function camelCase has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const camelCase = (input: string | string[], options?: CamelCaseType): string => {
                options = {
                  pascalCase: false,
                  ...(options ? options : {}),
                }
              Severity: Minor
              Found in src/string/camelCase.ts - About 1 hr to fix

                Function defaults has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function defaults(
                  origin: Record<PropertyKey, any>,
                  ...destinations: Record<PropertyKey, any>[]
                ): Record<PropertyKey, any> {
                  const ln = destinations.length
                Severity: Minor
                Found in src/object/defaults.ts - About 1 hr to fix

                  Function preserveCamelCase has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const preserveCamelCase = (value: string): string => {
                    let isLastCharLower = false
                    let isLastCharUpper = false
                    let isLastLastCharUpper = false
                  
                  
                  Severity: Minor
                  Found in src/string/camelCase.ts - About 1 hr to fix

                    Function toQueryString has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function toQueryString(
                      object: Record<string, any>,
                      recursive: boolean = false,
                      options: ToQueryStringOptions = { encodeName: true }
                    ) {
                    Severity: Minor
                    Found in src/object/toQueryString.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

                    Severity
                    Category
                    Status
                    Source
                    Language