hadmean/hadmean

View on GitHub

Showing 150 of 428 total issues

Function EntityCrudSettings has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function EntityCrudSettings() {
  const tabFromUrl = useRouteParam("tab");
  const changeTabParam = useChangeRouterParam("tab");
  const entity = useEntitySlug();

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

    Function Template has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Template: Story<ITableProps<unknown>> = (args) => {
      const [paginatedDataState, setPaginatedDataState] = useState<
        IPaginatedDataState<any>
      >({ ...DEFAULT_TABLE_STATE });
    
    
    Severity: Minor
    Found in src/frontend/design-system/components/Table/Stories.tsx - About 1 hr to fix

      Function crudEnabledValidationImpl has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const crudEnabledValidationImpl: ValidationImplType<void> = async (
        req,
        action: unknown
      ) => {
        progammingError("Please provide the action for the CRUD check", !action);
      Severity: Minor
      Found in src/backend/lib/request/validations/implementations/crud-enabled.ts - About 1 hr to fix

        Function listData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async listData(
            entity: string,
            searchValue?: string
          ): Promise<{ value: string; label: string }[]> {
            const [relationshipSettings, primaryField] = await Promise.all([
        Severity: Minor
        Found in src/backend/data/data.service.ts - About 1 hr to fix

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

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

            Function defaultWidgets has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    .map(async (entity, index) => {
                      const dateField =
                        await this._entitiesApiService.getEntityFirstFieldType(
                          entity.value,
                          "date"
            Severity: Minor
            Found in src/backend/dashboard-widgets/dashboard-widgets.service.ts - About 1 hr to fix

              Function StorageIntegrations has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function StorageIntegrations() {
                const fileStorageDomainMessages = useDomainMessages(
                  LANG_DOMAINS.INTEGRATIONS.FILE_STORAGE
                );
                useSetPageDetails({
              Severity: Minor
              Found in src/frontend/views/integrations/storage/index.tsx - About 1 hr to fix

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

                  filterOperatorToQuery(
                    query: T,
                    column: string,
                    { operator, value, value2 }: IColumnFilterBag<unknown>,
                    groupOperator: "and" | "or"
                Severity: Minor
                Found in src/backend/data/data-access/_Base.ts - 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 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/ErrorBoundary/index.tsx - About 1 hr to fix

                      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 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/design-system/components/ListManager/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 WidgetFrame has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  ({ setting, config, type, data, isPreview, Component }, ref) => {
                                    const navigationLink = useWidgetNavigationLink(
                                      config.entity,
                                      config.queryId
                                    );
                                Severity: Minor
                                Found in src/frontend/views/Dashboard/Widget/_components/WidgetFrame/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 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

                                Severity
                                Category
                                Status
                                Source
                                Language