baublet/w8mngr

View on GitHub

Showing 137 of 365 total issues

Avoid too many return statements within this function.
Open

  if (userKey === "right" && eventKey !== "ArrowRight") return;
Severity: Major
Found in client/helpers/useKeyPressHandler.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return undefined;
    Severity: Major
    Found in client/components/Forms/Upload.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return undefined;
      Severity: Major
      Found in client/components/Forms/Upload.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return 0;
        Severity: Major
        Found in api/helpers/buildConnectionResolver/buildConnectionResolver.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return selectedFile.smallUrl;
          Severity: Major
          Found in client/components/Forms/Upload.tsx - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return num;
            Severity: Major
            Found in api/helpers/buildConnectionResolver/buildConnectionResolver.ts - About 30 mins to fix

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

              async function seedFoods() {
                console.log("Seeding foods");
                let total = 0;
              
                for (const user of users) {
              Severity: Minor
              Found in scripts/seedData.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 seedFoodEntries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              async function seedFoodEntries() {
                console.log("Seeding user foodLogs");
                let total = 0;
              
                for (const user of users) {
              Severity: Minor
              Found in scripts/seedData.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 getVisualizationDataResolvers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export function getVisualizationDataResolvers({
                activityId,
                activityType,
                userId,
                context,
              Severity: Minor
              Found in api/dataServices/activity/stats/visualizationData.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 BarcodeScanner has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export function BarcodeScanner({ day, close }: { day: string, close: () => void }) {
                // Good test code: "850009682307"
                const [codes, setCodes] = React.useState<string[]>([]);
                const [showShutter, setShowShutter] = React.useState(false);
                const [searchingBarcode, setSearchingBarcode] = React.useState(false);
              Severity: Minor
              Found in client/components/BarcodeScanner/BarcodeScanner.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 MarkdownRenderer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export function MarkdownRenderer(props: MarkdownProps) {
                const text = React.useMemo(() => {
                  if (!props.maxLength) {
                    return props.content;
                  }
              Severity: Minor
              Found in client/components/Markdown/Markdown.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 stats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export async function stats(
                context: Context,
                {
                  userId,
                  activityId,
              Severity: Minor
              Found in api/dataServices/activity/stats/stats.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 usePaginatedQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export function usePaginatedQuery<
                THookFn extends HookFunction,
                TGetConnection extends GetConnectionFn<THookFn>
              >(
                useQuery: THookFn,
              Severity: Minor
              Found in client/helpers/usePaginatedQuery.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 DayNavigator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export function DayNavigator({
                rootUrl,
                onRefresh = inert,
              }: {
                onRefresh?: () => void;
              Severity: Minor
              Found in client/components/DayNavigator.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 MuscleMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export function MuscleMap({
                active = false,
                selected = [],
                showSummary = false,
                onChange,
              Severity: Minor
              Found in client/components/MuscleMap/MuscleMap.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 ActivityTileMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export function ActivityTileMap({
                data,
                activityType,
                activityId,
              }: {
              Severity: Minor
              Found in client/components/Activity/ActivityTileMap.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 log has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export function log(
                level: "debug" | "error" | "info" | "warn",
                message: string,
                details?: Record<string, any>
              ): void {
              Severity: Minor
              Found in api/config/log.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

              Severity
              Category
              Status
              Source
              Language