dashpresshq/dashpress

View on GitHub

Showing 165 of 459 total issues

Function BaseManageVariables has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function BaseManageVariables() {
  const [currentTab, setCurrentTab] = useState<IntegrationsConfigurationGroup>(
    IntegrationsConfigurationGroup.Constants
  );
  const constantsDomainMessages = useDomainMessages(
Severity: Minor
Found in src/frontend/views/settings/Variables/Base.tsx - About 1 hr to fix

    Function MetaDataSettings has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function MetaDataSettings() {
      const domainMessages = useAppConfigurationDomainMessages("metadata_columns");
    
      const metaDataColumns = useAppConfiguration("metadata_columns");
    
    
    Severity: Minor
    Found in src/frontend/views/settings/Data/index.tsx - About 1 hr to fix

      Function runValidationError has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        (values: Record<string, unknown>) => {
          const validations = Object.fromEntries(
            typescriptSafeObjectDotEntries(fields).map(([field, config]) => {
              const validationsToRun = config.validations || [];
      
      
      Severity: Minor
      Found in src/shared/validations/run.ts - About 1 hr to fix

        Function hexToOklch has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const hexToOklch = (hex: string) => {
          const hexToRGB = (h: string): TRGB => {
            const r: number = parseInt(h.slice(1, 3), 16);
            const g: number = parseInt(h.slice(3, 5), 16);
            const b: number = parseInt(h.slice(5, 7), 16);
        Severity: Minor
        Found in src/frontend/lib/colors/conversion.ts - About 1 hr to fix

          Function getEntitySelectionConfig has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const getEntitySelectionConfig = (
            entityType: EntityTypesForSelection,
            preSelectedType: IColorableSelection[],
            enumList$1: string[]
          ): IColorableSelection[] => {
          Severity: Minor
          Found in src/shared/logic/entities/getEntitySelectionConfig.ts - About 1 hr to fix

            Function useTableColumns has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export const useTableColumns = (
              entity: string
            ): Partial<DataStateKeys<ITableColumn[]>> => {
              const portalTableColumns = usePortalTableColumns(entity);
              const getEntityFieldLabels = useEntityFieldLabels(entity);
            Severity: Minor
            Found in src/frontend/views/data/Table/useTableColumns.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 useWaitForResponseMutationOptions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function useWaitForResponseMutationOptions<V, R = void>(
              options: IWaitForResponseMutationOptions<V, R>
            ) {
              const queryClient = useQueryClient();
              const { toast } = useToast();

            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 runFormAction has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const runFormAction = async (
              entity: string,
              dataEventAction: DataEventActions,
              getData: () => Promise<Record<string, unknown>>,
              authProfile: IAccountProfile
            Severity: Minor
            Found in src/backend/form-actions/run-form-action.ts - About 1 hr to fix

              Function useApi has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function useApi<T>(endPoint: string, options: IUseApiOptions<T>) {
                const isRestoring = useIsRestoring();
              
                const builtOptions = buildApiOptions(options);
                const router = useRouter();
              Severity: Minor
              Found in src/frontend/lib/data/useApi/index.ts - About 1 hr to fix

                Function getDbInstance has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  async getDbInstance(): Promise<Knex> {
                    if (DatabaseConfigDataPersistenceAdaptor._dbInstance) {
                      return DatabaseConfigDataPersistenceAdaptor._dbInstance;
                    }
                
                

                  Function validations has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        typescriptSafeObjectDotEntries(fields).map(([field, config]) => {
                          const validationsToRun = config.validations || [];
                  
                          const firstFailedValidation = validationsToRun.find((validation) =>
                            ENTITY_VALIDATION_CONFIG[validation.validationType]?.implementation(
                  Severity: Minor
                  Found in src/shared/validations/run.ts - About 1 hr to fix

                    Function CredentialsSetup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const CredentialsSetup: CustomNextPage = () => {
                      const setupCredentialsMutation = useSetupCredentialsMutation();
                    
                      const isChecking = useSetupCheck([
                        {
                    Severity: Minor
                    Found in src/frontend/views/setup/Credentials/index.tsx - About 1 hr to fix

                      Function useSyncTableState has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function useSyncTableState<T>(
                        table: Table<Record<string, unknown>>,
                        overridePaginatedDataState: IPaginatedDataState<T> | undefined,
                        syncPaginatedDataStateOut: (params: IPaginatedDataState<T>) => void
                      ) {
                      Severity: Minor
                      Found in src/frontend/components/app/table/hooks.tsx - About 1 hr to fix

                        Function useStringSelections has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function useStringSelections(key: string) {
                          const [values, set] = useSelectionStore((store) => [store.values, store.set]);
                        
                          const selections = values[key] || {};
                        
                        
                        Severity: Minor
                        Found in src/frontend/lib/selection/index.ts - About 1 hr to fix

                          Function useWaitForResponseMutationOptions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function useWaitForResponseMutationOptions<V, R = void>(
                            options: IWaitForResponseMutationOptions<V, R>
                          ) {
                            const queryClient = useQueryClient();
                            const { toast } = useToast();

                            Function integrationsConfigurationDetailsRequestHandler has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const integrationsConfigurationDetailsRequestHandler = (
                              group: IntegrationsConfigurationGroup
                            ) => {
                              return requestHandler(
                                {
                            Severity: Minor
                            Found in src/pages/api/integrations/_base/[key].ts - About 1 hr to fix

                              Function DetailsCanvas has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function DetailsCanvas() {
                                const router = useRouter();
                                const [closeDetailsCanvas, detailsCanvasEntity, detailsCanvasId] =
                                  useDetailsOffCanvasStore((state) => [state.close, state.entity, state.id]);
                              
                              
                              Severity: Minor
                              Found in src/frontend/views/data/Table/_WholeEntityTable/DetailsCanvas.tsx - About 1 hr to fix

                                Function EntityFormExtensionSettings has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function EntityFormExtensionSettings() {
                                  const entity = useEntitySlug();
                                
                                  const domainMessages = useAppConfigurationDomainMessages(
                                    "entity_form_extension"
                                Severity: Minor
                                Found in src/frontend/views/entity/Form/index.tsx - About 1 hr to fix

                                  Function Select has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export function Select({
                                    onChange,
                                    options: fullOptions,
                                    disabled,
                                    isLoading,
                                  Severity: Minor
                                  Found in src/frontend/components/ui/select.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 EntityFormActionsSettings has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function EntityFormActionsSettings() {
                                    const entity = useEntitySlug();
                                    const domainMessages = useDomainMessages(
                                      LANG_DOMAINS.INTEGRATIONS.FORM_ACTIONS
                                    );
                                  Severity: Minor
                                  Found in src/frontend/views/entity/Actions/index.tsx - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language