trezy/transform-string-case

View on GitHub

Showing 11 of 11 total issues

Function transformStringCase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const transformStringCase = (string, from, to) => {
  const regex = {
    camel: /(ID|[A-Z])/u,
    upperCamel: /(ID|[A-Z])/gu,
    snake: /_(ID|\w)/ui,
Severity: Minor
Found in src/transformStringCase.js - About 25 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

No licenses found for url. Either the library reports the licenses in an unsupported format, or the library is unlicensed.
Open

url@^0.11.0:
Severity: Minor
Found in yarn.lock by git-legal

No licenses found for util. Either the library reports the licenses in an unsupported format, or the library is unlicensed.
Open

util@0.10.3:
Severity: Minor
Found in yarn.lock by git-legal

No licenses found for enhanced-resolve. Either the library reports the licenses in an unsupported format, or the library is unlicensed.
Open

enhanced-resolve@^4.1.0:
Severity: Minor
Found in yarn.lock by git-legal

No licenses found for ejs. Either the library reports the licenses in an unsupported format, or the library is unlicensed.
Open

ejs@1.0.0:
Severity: Minor
Found in yarn.lock by git-legal

No licenses found for enhanced-resolve. Either the library reports the licenses in an unsupported format, or the library is unlicensed.
Open

enhanced-resolve@^4.1.0:
Severity: Minor
Found in yarn.lock by git-legal

No licenses found for log-driver. Either the library reports the licenses in an unsupported format, or the library is unlicensed.
Open

log-driver@^1.2.7:
Severity: Minor
Found in yarn.lock by git-legal

No licenses found for jest-get-type. Either the library reports the licenses in an unsupported format, or the library is unlicensed.
Open

jest-get-type@^22.1.0:
Severity: Minor
Found in yarn.lock by git-legal

Library semantic-release contains unrecogonized licenses: MIT License 2015.0
Open

semantic-release@^15.13.18:
Severity: Minor
Found in yarn.lock by git-legal

No licenses found for tmp. Either the library reports the licenses in an unsupported format, or the library is unlicensed.
Open

tmp@^0.0.33:
Severity: Minor
Found in yarn.lock by git-legal

No licenses found for util. Either the library reports the licenses in an unsupported format, or the library is unlicensed.
Open

util@0.10.3:
Severity: Minor
Found in yarn.lock by git-legal
Severity
Category
Status
Source
Language