pankod/refine

View on GitHub

Showing 959 of 983 total issues

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

  const imageFields = (field: InferField) => {
    if (field.type === "image") {
      imports.push(
        ["Upload", "antd"],
        ["getValueFromEvent", "@refinedev/antd"],
Severity: Minor
Found in packages/inferencer/src/inferencers/antd/edit.tsx - About 2 hrs to fix

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

      const imageFields = (field: InferField) => {
        if (field.type === "image") {
          imports.push(
            ["Upload", "antd"],
            ["getValueFromEvent", "@refinedev/antd"],
    Severity: Minor
    Found in packages/inferencer/src/inferencers/antd/create.tsx - About 2 hrs to fix

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

        const renderRelationFields = (field: InferField) => {
          if (field.relation && field.resource) {
            imports.push(["Select", "antd"]);
            const variableName = getVariableName(field.key, "SelectProps");
      
      
      Severity: Minor
      Found in packages/inferencer/src/inferencers/antd/create.tsx - About 2 hrs to fix

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

          const renderRelationFields = (field: InferField) => {
            if (field.relation && field.resource) {
              imports.push(["Select", "antd"]);
              const variableName = getVariableName(field.key, "SelectProps");
        
        
        Severity: Minor
        Found in packages/inferencer/src/inferencers/antd/edit.tsx - About 2 hrs to fix

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

            go: () => {
              const { push, replace, asPath: pathname } = useRouter();
          
              const fn = React.useCallback(
                ({
          Severity: Minor
          Found in packages/nextjs-router/src/pages/bindings.tsx - About 1 hr to fix

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

              go: () => {
                const { push, replace } = useRouter();
                const pathname = usePathname();
                const searchParamsObj = useSearchParams();
            
            
            Severity: Minor
            Found in packages/nextjs-router/src/app/bindings.tsx - About 1 hr to fix

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

                const dateFields = (field: InferField) => {
                  if (field.type === "date") {
                    imports.push(["DatePicker", "antd"], ["dayjs", "dayjs", true]);
              
                    if (field.multiple) {
              Severity: Minor
              Found in packages/inferencer/src/inferencers/antd/edit.tsx - About 1 hr to fix

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

                  const booleanFields = (field: InferField) => {
                    if (field.type === "boolean") {
                      imports.push(["Checkbox", "antd"]);
                
                      if (field.multiple) {
                Severity: Minor
                Found in packages/inferencer/src/inferencers/antd/edit.tsx - About 1 hr to fix

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

                  export const generateFilter = (filter: CrudFilter, query: any) => {
                    switch (filter.operator) {
                      case "eq":
                        return query.eq(filter.field, filter.value);
                      case "ne":
                  Severity: Minor
                  Found in packages/supabase/src/utils/generateFilter.ts - About 1 hr to fix

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

                    export const Feed = () => {
                      const [feed, setFeed] = React.useState<FeedType | null>(null);
                    
                      const fetchFeed = React.useCallback(async () => {
                        try {
                    Severity: Minor
                    Found in packages/devtools-ui/src/components/feed.tsx - About 1 hr to fix

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

                      export const addV3LegacyAuthProviderCompatibleTrueToAuthHooks = (
                        j: JSCodeshift,
                        root: Collection<any>,
                      ) => {
                        const authHooks = root.find(j.CallExpression, {

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

                          const basicFields = (field: InferField) => {
                            if (field && (field.type === "text" || field.type === "number")) {
                              const id = `id: "${field.key}"`;
                              const accessorKey = getAccessorKey(field);
                              const header = `header: ${translatePrettyString({
                        Severity: Minor
                        Found in packages/inferencer/src/inferencers/mantine/list.tsx - About 1 hr to fix

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

                            const emailFields = (field: InferField) => {
                              if (field.type === "email") {
                                if (field.multiple) {
                                  const val = accessor("item", undefined, field.accessor);
                                  return jsx`
                          Severity: Minor
                          Found in packages/inferencer/src/inferencers/headless/show.tsx - About 1 hr to fix

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

                              const urlFields = (field: InferField) => {
                                if (field.type === "url") {
                                  if (field.multiple) {
                                    const val = accessor("item", undefined, field.accessor);
                                    return jsx`
                            Severity: Minor
                            Found in packages/inferencer/src/inferencers/headless/show.tsx - About 1 hr to fix

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

                                const basicFields = (field: InferField) => {
                                  if (field && (field.type === "text" || field.type === "number")) {
                                    const id = `id: "${field.key}"`;
                                    const accessorKey = getAccessorKey(field);
                                    const header = `header: ${translatePrettyString({
                              Severity: Minor
                              Found in packages/inferencer/src/inferencers/chakra-ui/list.tsx - About 1 hr to fix

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

                                export const useTelemetryData = (): ITelemetryData => {
                                  const auth = useIsExistAuthentication();
                                  const auditLogContext = useContext(AuditLogContext);
                                  const { liveProvider } = useContext(LiveContext);
                                  const routerContext = useContext(LegacyRouterContext);
                                Severity: Minor
                                Found in packages/core/src/hooks/useTelemetryData/index.ts - About 1 hr to fix

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

                                    parse: () => {
                                      const params = useParams();
                                      const { pathname, search } = useLocation();
                                      const { resources } = useContext(ResourceContext);
                                  
                                  
                                  Severity: Minor
                                  Found in packages/remix/src/bindings.tsx - About 1 hr to fix

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

                                    export const Create: React.FC<CreateProps> = ({
                                      title,
                                      saveButtonProps: saveButtonPropsFromProps,
                                      children,
                                      resource: resourceFromProps,
                                    Severity: Minor
                                    Found in packages/antd/src/components/crud/create/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 RegisterPage has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export const RegisterPage: React.FC<RegisterProps> = ({
                                      providers,
                                      loginLink,
                                      wrapperProps,
                                      contentProps,

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

                                    export const LoginPage: React.FC<LoginProps> = ({
                                      providers,
                                      registerLink,
                                      forgotPasswordLink,
                                      rememberMe,
                                    Severity: Minor
                                    Found in packages/antd/src/components/pages/auth/components/login/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