ctrl-alt-del-world/midway

View on GitHub

Showing 47 of 47 total issues

Avoid too many return statements within this function.
Open

          return updateEverything(data, inputObject)
Severity: Major
Found in web/src/lambda/shopify-sync.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return client
          .patch(data.id.toString())
          .set({ 'content.shopify.deleted': true })
          .commit()
          .then(deletedObject => {
    Severity: Major
    Found in web/src/lambda/shopify-sync.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return statusReturn(500, { error: err.message })
      Severity: Major
      Found in web/src/lambda/register.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                  return statusReturn(200, { error: 'Problem with mutation' })
        Severity: Major
        Found in web/src/lambda/shopify-sync.ts - About 30 mins to fix

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

          export const ForgotPassword = ({ path }: { path: string }) => {
            const [formSuccess, setFormSuccess] = useState(false)
            const form = React.createRef() as React.RefObject<HTMLFormElement>
          
            const handleForgot = useCallback(
          Severity: Minor
          Found in web/src/components/auth/forgotPassword.tsx - 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

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

          export const handler = async (event: APIGatewayEvent): Promise<any> => {
            if (event.httpMethod !== 'POST' || !event.body) return statusReturn(400, '')
          
            try {
              data = JSON.parse(event.body)
          Severity: Minor
          Found in web/src/lambda/activate.ts - 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

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

          export const Image = ({ imageId, className, width, alt, src }: {
            imageId?: string
            width?: number
            alt?: string
            className?: string
          Severity: Minor
          Found in web/src/components/image.tsx - 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

          Severity
          Category
          Status
          Source
          Language