dashpresshq/dashpress

View on GitHub

Showing 165 of 459 total issues

Function FormFileInput has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function FormFileInput({
  input,
  meta,
  disabled,
  uploadUrl,
Severity: Minor
Found in src/frontend/design-system/components/Form/File/index.tsx - About 35 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 handleRequestError has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const handleRequestError = async (response: Response, errorMessage: string) => {
  if (response.ok) {
    return;
  }
  const error = await response.json();
Severity: Minor
Found in src/frontend/lib/data/makeRequest.ts - About 35 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

Avoid too many return statements within this function.
Open

        return (
          <OptionTag
            spectrum={availableOption.spectrum}
            label={availableOption.label}
            value={availableOption.value}
Severity: Major
Found in src/frontend/views/data/viewSpecialDataTypes.tsx - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return (
          <ReferenceComponent
            entity={entityToOneReferenceFields?.[fieldName]}
            id={value as string}
            displayFrom={options.displayFrom}
    Severity: Major
    Found in src/frontend/views/data/viewSpecialDataTypes.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return permissions.includes(requiredPermission);
      Severity: Major
      Found in src/shared/logic/permissions/index.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return filterType;
        Severity: Major
        Found in src/frontend/views/data/Table/useTableColumns.tsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return new Date();
          Severity: Major
          Found in src/backend/data/data-access/time.constants.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return null;
            Severity: Major
            Found in src/frontend/views/data/viewSpecialDataTypes.tsx - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return operatorConfig[QueryOperators.BETWEEN](
                        query,
                        column,
                        timeBetween
                      );
              Severity: Major
              Found in src/backend/data/data-access/_Base.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return i18n._(availableOption.label);
                Severity: Major
                Found in src/frontend/views/data/viewSpecialDataTypes.tsx - About 30 mins to fix

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

                  export const useEntityViewStateMachine = ({
                    crudAction,
                    entity,
                    error,
                    isLoading,
                  Severity: Minor
                  Found in src/frontend/views/data/hooks/useEntityViewStateMachine.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 paginationFilterValidationImpl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  > = async (req, ignoreFieldsValidation) => {
                    const take = Number(req.query.take) || 10;
                    const page = Number(req.query.page) || 1;
                  
                    const orderBy = req.query.orderBy === "desc" ? "desc" : "asc";
                  Severity: Minor
                  Found in src/backend/lib/request/validations/implementations/pagination-filter.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 DropDownMenu has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function DropDownMenu({
                    menuItems: menuItems$1,
                    ellipsis,
                    ariaLabel,
                    contentClassName,
                  Severity: Minor
                  Found in src/frontend/components/app/drop-drop-menu/index.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 RenderFormInput has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function RenderFormInput(props: IRenderFormInputProps) {
                    const {
                      formProps: formProps$1,
                      label,
                      type,
                  Severity: Minor
                  Found in src/frontend/components/app/form/schema/_RenderFormInput.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 BaseManageDashboardWidget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function BaseManageDashboardWidget({ onSave, action }: IProps) {
                    const dashboardId = useRouteParam("dashboardId");
                    const widgetId = useRouteParam("widgetId");
                    const activeEntities = useActiveEntities();
                    const widgets = useDashboardWidgets(dashboardId);
                  Severity: Minor
                  Found in src/frontend/views/Dashboard/Widget/_manage/index.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 BaseEntityForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function BaseEntityForm({
                    entity,
                    initialValuesData,
                    crudAction,
                    allOptional,
                  Severity: Minor
                  Found in src/frontend/views/data/_BaseEntityForm.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 doesPermissionAllowPermission has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const doesPermissionAllowPermission = (
                    permissions: string[],
                    requiredPermission: string,
                    checkGranular: boolean
                  ): boolean => {
                  Severity: Minor
                  Found in src/shared/logic/permissions/index.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 SectionBox has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function SectionBox({
                    children,
                    title,
                    isLoading,
                    description,
                  Severity: Minor
                  Found in src/frontend/components/app/section-box/index.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 useFEPagination has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function useFEPagination<T>(
                    endPoint: string,
                    dataState: IPaginatedDataState<T>
                  ): UseQueryResult<PaginatedData<T>> {
                    return useQuery<PaginatedData<T>>({
                  Severity: Minor
                  Found in src/frontend/components/app/pagination-table/useFEPagination.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 Presentation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function Presentation({
                    isSubmitting,
                    disabled,
                    value,
                    error,
                  Severity: Minor
                  Found in src/frontend/design-system/components/Form/File/Presentation.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