dashpresshq/dashpress

View on GitHub

Showing 157 of 428 total issues

Function RolePermissions has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function RolePermissions() {
  const activeEntities = useActiveEntities();
  const portalPermission = usePortalExtendedPermissions();
  const rolePermissions = useRolePermissions();
  const portalUserPermissions = usePortalUserPermissions();
Severity: Major
Found in src/frontend/views/roles/Permissions/index.tsx - About 2 hrs to fix

    Function ConfirmAlert has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function ConfirmAlert() {
      const rootRef = useRef<HTMLDivElement>(null);
    
      const { _ } = useLingui();
      const [title, action, onClose] = useConfirmAlertStore((store) => [
    Severity: Major
    Found in src/frontend/design-system/components/ConfirmAlert/index.tsx - About 2 hrs to fix

      Function useEntityFieldValidations has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function useEntityFieldValidations(entity: string) {
        const entityValidationsMap = useEntityConfiguration(
          "entity_validations",
          entity
        );
      Severity: Major
      Found in src/frontend/hooks/entity/entity.config.ts - About 2 hrs to fix

        Function ViewsDocumentation has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function ViewsDocumentation() {
          return (
            <DocumentationRoot>
              <p>
                Views enable you to implement query tabs. Say you have an{" "}
        Severity: Major
        Found in src/frontend/docs/views.tsx - About 2 hrs to fix

          Function EntityRelationTable has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function EntityRelationTable() {
            const parentEntity = useEntitySlug();
            const entityId = useEntityId();
            const { _ } = useLingui();
            const childEntity = useRouteParam("childEntity");
          Severity: Major
          Found in src/frontend/views/data/Details/RelationsTable.tsx - About 2 hrs to fix

            File Form.tsx has 259 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { QueryFilterSchema } from "shared/types/data";
            import { Form, Field, useField } from "react-final-form";
            import arrayMutators from "final-form-arrays";
            import { FieldArray } from "react-final-form-arrays";
            import { ACTIONS_ACCESSOR } from "frontend/views/data/Table/useTableColumns";
            Severity: Minor
            Found in src/frontend/views/entity/PersistentQuery/Form.tsx - About 2 hrs to fix

              Function select has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  select: (data: any) => {
                    let returnData: T[] = data as unknown as T[];
                    if (dataState.filters) {
                      returnData = returnData.filter((datum) => {
                        return dataState.filters.every(($filter) => {
              Severity: Major
              Found in src/frontend/components/FEPaginationTable/useFEPagination.ts - About 2 hrs to fix

                Function FormSelect has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function FormSelect(formInput: IFormSelect) {
                  const {
                    input,
                    selectData,
                    meta,
                Severity: Major
                Found in src/frontend/design-system/components/Form/Select/index.tsx - About 2 hrs to fix

                  File index.tsx has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { useId } from "react";
                  import { ChevronRight as ChevronRightIcon } from "react-feather";
                  import Link from "next/link";
                  import styled, { css } from "styled-components";
                  import { USE_ROOT_COLOR } from "frontend/design-system/theme/root";

                    Function DateSettings has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function DateSettings() {
                      const domainMessages = useAppConfigurationDomainMessages(
                        "default_date_format"
                      );
                    
                    
                    Severity: Major
                    Found in src/frontend/views/settings/Data/index.tsx - About 2 hrs to fix

                      Function ListManagerItem has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function ListManagerItem({
                        label,
                        systemIcon,
                        disabled,
                        subLabel,

                      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 Table has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function Table<T extends unknown>({
                        overridePaginatedDataState,
                        tableData,
                        syncPaginatedDataStateOut,
                        columns,
                      Severity: Minor
                      Found in src/frontend/design-system/components/Table/index.tsx - About 2 hrs 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 useNavigationStack has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const useNavigationStack = () => {
                        const router = useRouter();
                        const { _ } = useLingui();
                      
                        const [history, setHistory] = useNavigationHistoryStore((store) => [
                      Severity: Major
                      Found in src/frontend/lib/routing/useNavigationStack.ts - About 2 hrs to fix

                        Function SystemSettings has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function SystemSettings() {
                          const systemSettings = useAppConfiguration("system_settings");
                          const domainMessages = useAppConfigurationDomainMessages("system_settings");
                        
                          const documentationActionButton = useDocumentationActionButton(
                        Severity: Major
                        Found in src/frontend/views/settings/System/index.tsx - About 2 hrs to fix

                          Function formatIntrospectData has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            private formatIntrospectData(rawEntity: Entity[]): IDBSchema[] {
                              const dbSchema = rawEntity
                                .filter(({ name }) => !name.startsWith("dashpress"))
                                .map((entity) => {
                                  return {
                          Severity: Minor
                          Found in src/backend/schema/schema.service.ts - About 2 hrs to fix

                            Function parseForm has 49 lines of code (exceeds 25 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 1 hr to fix

                              Function NavigationSkeleton has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function NavigationSkeleton() {
                                const getThemeColorShade = useThemeColorShade();
                              
                                const SCHEMA = [
                                  "header",
                              Severity: Minor
                              Found in src/frontend/_layouts/app/NavigationSideBar/NavigationSkeleton.tsx - About 1 hr to fix

                                Function EntitiesSettings has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function EntitiesSettings() {
                                  const domainMessages = useAppConfigurationDomainMessages("disabled_entities");
                                  const entitiesList = useEntitiesList();
                                
                                  useSetPageDetails({
                                Severity: Minor
                                Found in src/frontend/views/settings/Entities/index.tsx - About 1 hr to fix

                                  Function viewSpecialDataTypes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export const viewSpecialDataTypes = ({
                                    fieldName,
                                    value,
                                    entityToOneReferenceFields = {},
                                    entityFieldSelections = {},
                                  Severity: Minor
                                  Found in src/frontend/views/data/viewSpecialDataTypes.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 AsyncFormSelect has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export function AsyncFormSelect(props: IProps) {
                                    const {
                                      input,
                                      url,
                                      referenceUrl,
                                  Severity: Minor
                                  Found in src/frontend/design-system/components/Form/Select/Async/index.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language