dashpresshq/dashpress

View on GitHub

Showing 165 of 459 total issues

Function AsyncFormSelect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export function AsyncFormSelect(props: IProps) {
  const { _ } = useLingui();

  const { input, url, referenceUrl } = props;

Severity: Minor
Found in src/frontend/components/app/form/input/select-async.tsx - About 1 hr 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 EntityRelationDetails has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export function EntityRelationDetails() {
  const childEntity = useRouteParam("childEntity");
  const childEntityCrudConfig = useEntityCrudConfig(childEntity);
  const entityId = useEntityId();
  const parentEntity = useEntitySlug();
Severity: Minor
Found in src/frontend/views/data/Details/RelationsDetails.tsx - About 1 hr 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 AccountProfile has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function AccountProfile() {
  const authenticatedUserBag = useAuthenticatedUserBag();
  const updateProfileMutation = useUpdateProfileMutation();
  const domainMessages = useDomainMessages(LANG_DOMAINS.ACCOUNT.PROFILE);

Severity: Minor
Found in src/frontend/views/account/Profile/index.tsx - About 1 hr to fix

    Function useTableState has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const useTableState = (
      contextKey: string,
      persistentFilters: IDataTableProps["persistentFilters"],
      defaultTableState?: IDataTableProps["defaultTableState"]
    ) => {
    Severity: Minor
    Found in src/frontend/views/data/Table/hooks/useTableState.ts - About 1 hr to fix

      Function create has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async create(
          entity: string,
          data: Record<string, unknown>,
          accountProfile: IAccountProfile
        ): Promise<string | number> {
      Severity: Minor
      Found in src/backend/data/data.service.ts - About 1 hr to fix

        Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const { error } = this.state;
            const { children } = this.props;
            if (error) {
              return (
        Severity: Minor
        Found in src/frontend/components/app/error-boundary.tsx - About 1 hr to fix

          Function GET has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              GET: async (): Promise<Record<string, string>> => {
                const latestVersion$1 = await latestVersion("dashpress");
          
                const versionText =
                  latestVersion$1 === version
          Severity: Minor
          Found in src/pages/api/versions.ts - About 1 hr to fix

            Function createConfigDomainPersistenceService has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function createConfigDomainPersistenceService<T>(
              configDomain: ConfigDomain
            ): AbstractConfigDataPersistenceService<T> {
              const configBag: Record<
                ConfigAdaptorTypes,
            Severity: Minor
            Found in src/backend/lib/config-persistence/index.ts - About 1 hr to fix

              Function showData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async showData(
                  entity: string,
                  id: string | number,
                  column?: string
                ): Promise<Record<string, unknown>> {
              Severity: Minor
              Found in src/backend/data/data.service.ts - About 1 hr to fix

                Function getEntitySelections has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const getEntitySelections = (
                  entityFields: IEntityField[],
                  entitySelections: Record<string, IColorableSelection[]>,
                  entityFieldTypes: Record<string, FormFieldTypes>
                ): Record<string, IColorableSelection[]> => {
                Severity: Minor
                Found in src/shared/logic/entities/getEntitySelections.ts - About 1 hr to fix

                  Function ListManager has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function ListManager<T, K extends StringProps<T>>({
                    labelField,
                    listLengthGuess,
                    getLabel,
                    items,
                  Severity: Minor
                  Found in src/frontend/components/app/list-manager/index.tsx - About 55 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 SoftButton has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function SoftButton({
                    label,
                    size,
                    systemIcon,
                    shouldConfirmAlert,
                  Severity: Minor
                  Found in src/frontend/components/app/button/soft.tsx - About 55 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 SideBar has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function SideBar({ isFullWidth, setIsFullWidth }: IProps) {
                    const siteConfig = useAppConfiguration("site_settings");
                    const navigationMenuItems = useNavigationMenuItems();
                  
                    const [activeItem, setActiveItem$1] = useSessionStorage<
                  Severity: Minor
                  Found in src/frontend/_layouts/app/NavigationSideBar/SideBar.tsx - About 55 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 isAuthenticatedValidationImpl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const isAuthenticatedValidationImpl: ValidationImplType<void> = async (
                    req,
                    protectedRoute: boolean
                  ) => {
                    try {
                  Severity: Minor
                  Found in src/backend/lib/request/validations/implementations/is-authenticated.ts - About 45 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 WidgetFrameCmp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    function WidgetFrameCmp(
                      { setting, config, type, data, isPreview, Component },
                      ref
                    ) {
                      const navigationLink = useWidgetNavigationLink(
                  Severity: Minor
                  Found in src/frontend/views/Dashboard/Widget/_components/WidgetFrame/index.tsx - About 45 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 useApiMutateOptimisticOptions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function useApiMutateOptimisticOptions<T, V, R = void>(
                    options: IApiMutateOptions<T, V, R>
                  ) {
                    const apiMutate = useApiMutate<T>(options.dataQueryPath);
                    const queryClient = useQueryClient();
                  Severity: Minor
                  Found in src/frontend/lib/data/useMutate/useApiMutateOptimisticOptions.ts - About 45 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 parseForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export async function parseForm(
                    req: NextApiRequest
                  ): Promise<{ fields: formidable.Fields; files: formidable.Files }> {
                    const fileUploadSettings = await configurationApiService.show(
                      "file_upload_settings"
                  Severity: Minor
                  Found in src/backend/uploads/parse.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

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

                  function useEntityCrudView(entity: string) {
                    const entityCrudSettings = useEntityCrudSettings(entity);
                    const entityFields = useEntityFields(entity);
                  
                    const upsertCrudSettingsMutation = useUpsertConfigurationMutation(
                  Severity: Minor
                  Found in src/frontend/views/entity/Crud/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 DetailsLayout has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function DetailsLayout({
                    children,
                    entity,
                    menuKey,
                    menuItems = [],
                  Severity: Minor
                  Found in src/frontend/views/data/Details/_Layout.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 handleValidation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    (
                      validate: (
                        value: unknown,
                        parameter?: unknown,
                        allValues?: Record<string, unknown>
                  Severity: Minor
                  Found in src/shared/validations/handle-validation.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

                  Severity
                  Category
                  Status
                  Source
                  Language