dashpresshq/dashpress

View on GitHub

Showing 459 of 459 total issues

Function SignIn has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const SignIn: CustomNextPage = () => {
  const render = useGuestCheck();
  const signInMutation = useSignInMutation();

  const setupCheck = useSetupCheck([
Severity: Minor
Found in src/frontend/views/SignIn/index.tsx - About 1 hr to fix

    Function Toaster has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function Toaster() {
      const { toasts } = useToast();
      const { _ } = useLingui();
    
      return (
    Severity: Minor
    Found in src/frontend/components/app/toast/toaster.tsx - About 1 hr to fix

      Function EntityUpdate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function EntityUpdate() {
        const entityId = useEntityId();
        const entity = useEntitySlug();
      
        useDataUpdateActions({ entity, entityId });
      Severity: Minor
      Found in src/frontend/views/data/Update/index.tsx - About 1 hr to fix

        Function ThemeSettings has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function ThemeSettings() {
          const themeColor = useAppConfiguration("theme_color");
          const domainMessages = useAppConfigurationDomainMessages("theme_color");
        
          const upsertConfigurationMutation =
        Severity: Minor
        Found in src/frontend/views/settings/Theme/index.tsx - About 1 hr to fix

          Function VersionInfo has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function VersionInfo() {
            const domainMessages = useDomainMessages({
              plural: msg`System Info`,
              singular: msg`System Info`,
            });
          Severity: Minor
          Found in src/frontend/views/settings/Versions/index.tsx - About 1 hr to fix

            Function UserSetup has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const UserSetup: CustomNextPage = () => {
              const setupUserMutation = useSetupUserMutation();
            
              const isChecking = useSetupCheck([
                {
            Severity: Minor
            Found in src/frontend/views/setup/User/index.tsx - About 1 hr to fix

              Function FormCodeEditor has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function FormCodeEditor(formInput: IFormCodeEditor) {
                const {
                  input: { onFocus, name, onBlur, ...inputProps },
                  meta,
                  language,
              Severity: Minor
              Found in src/frontend/components/app/form/input/code-editor.tsx - About 1 hr to fix

                Function IconInputField has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function IconInputField() {
                  return (
                    <Field name="icon" validateFields={[]} validate={required}>
                      {({ input, meta }) =>
                        SystemIconsList.includes(input.value as SystemIconsKeys) ? (
                Severity: Minor
                Found in src/frontend/components/app/form/input/icon/index.tsx - About 1 hr to fix

                  Function assertConfiguration has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    assertConfiguration() {
                      if (ConfigApiService.isInitialized) {
                        return;
                      }
                      ConfigApiService.isInitialized = true;
                  Severity: Minor
                  Found in src/backend/lib/config/config.service.ts - About 1 hr to fix

                    Function update has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      async update(
                        entity: string,
                        id: string,
                        data: Record<string, unknown>,
                        accountProfile: IAccountProfile,
                    Severity: Minor
                    Found in src/backend/data/data.service.ts - About 1 hr to fix

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

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

                        Function reducer has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const reducer = (state: State, action: Action): State => {
                          switch (action.type) {
                            case "ADD_TOAST":
                              return {
                                ...state,
                        Severity: Minor
                        Found in src/frontend/components/app/toast/use-toast.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 Table has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function Table<T extends unknown>({
                          overridePaginatedDataState,
                          tableData,
                          syncPaginatedDataStateOut,
                          columns,
                        Severity: Minor
                        Found in src/frontend/components/app/table/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

                        Function runValidationError has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                          (fields: IAppliedSchemaFormConfig<any>) =>
                          (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

                        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 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

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        <Input
                                          type="number"
                                          value={filterValue?.value2 || ""}
                                          onChange={(e) =>
                                            setFilter({
                                Severity: Major
                                Found in src/frontend/components/app/table/filters/Number.tsx and 1 other location - About 1 hr to fix
                                src/frontend/components/app/table/filters/Number.tsx on lines 12..22

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 66.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      <Input
                                        type="number"
                                        value={filterValue?.value || ""}
                                        onChange={(e) =>
                                          setFilter({
                                Severity: Major
                                Found in src/frontend/components/app/table/filters/Number.tsx and 1 other location - About 1 hr to fix
                                src/frontend/components/app/table/filters/Number.tsx on lines 24..34

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 66.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Severity
                                Category
                                Status
                                Source
                                Language