renzholy/mongood

View on GitHub

Showing 62 of 64 total issues

Avoid too many return statements within this function.
Open

    return {
      bsonType: ['date'],
    }
Severity: Major
Found in src/utils/schema.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return {
          bsonType: ['double'],
        }
    Severity: Major
    Found in src/utils/schema.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return undefined
      Severity: Major
      Found in src/utils/storage.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return val.$numberInt
        Severity: Major
        Found in src/utils/ejson.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return `{ ${entries
                .map(
                  ([key, value]) =>
                    `${wrapKey(key)}: ${stringify(
                      value,
          Severity: Major
          Found in src/utils/ejson.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return {
                  bsonType: ['maxKey'],
                }
            Severity: Major
            Found in src/utils/schema.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return `Timestamp(${val.$timestamp.t}, ${val.$timestamp.i})`
              Severity: Major
              Found in src/utils/ejson.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return null
                Severity: Major
                Found in src/components/pure/index-cell.tsx - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return {
                        bsonType: ['timestamp'],
                      }
                  Severity: Major
                  Found in src/utils/schema.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return item === null ? undefined : JSON.parse(item)
                    Severity: Major
                    Found in src/utils/storage.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return `MinKey()`
                      Severity: Major
                      Found in src/utils/ejson.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return val.length
                              ? `[\n${val
                                  .map(
                                    (v) =>
                                      `${extraSpaces}${spaces}${stringify(
                        Severity: Major
                        Found in src/utils/ejson.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return `NumberLong("${val.$numberLong}")`
                          Severity: Major
                          Found in src/utils/ejson.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return {
                                  bsonType: ['int'],
                                }
                            Severity: Major
                            Found in src/utils/schema.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return `NumberDecimal("${val.$numberDecimal}")`
                              Severity: Major
                              Found in src/utils/ejson.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                  return (
                                    <>
                                      <DefaultDialog
                                        hidden={isDialogHidden}
                                        title="Drop Index"
                                Severity: Major
                                Found in src/components/indexes-list.tsx - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                    return undefined
                                  Severity: Major
                                  Found in src/utils/map.ts - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return `BinData(${parseInt(val.$binary.subType, 16)}, "${
                                          val.$binary.base64
                                        }")`
                                    Severity: Major
                                    Found in src/utils/ejson.ts - About 30 mins to fix

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

                                      function postProcessSchema(schema: Schema): Schema {
                                        const bsonTypes = uniq(schema.bsonType)
                                        return omitBy(
                                          {
                                            bsonType: bsonTypes.length === 1 ? bsonTypes[0] : bsonTypes,
                                      Severity: Minor
                                      Found in src/utils/schema.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 ProfilingBottomStack has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      export default function ProfilingBottomStack() {
                                        const [{ conn, database }] = useRouterQuery()
                                        const connection = useConnection(conn)
                                        const host = useAppSelector((state) => state.profiling.host)
                                        const profilingConnection = host
                                      Severity: Minor
                                      Found in src/components/profiling-bottom-stack.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