danielwii/asuna-admin

View on GitHub

Showing 134 of 310 total issues

Function AsunaDataTable has 343 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const AsunaDataTable: React.FC<AsunaDataTableProps> = (props) => {
  const {
    creatable = false,
    editable = false,
    deletable = false,
Severity: Major
Found in src/components/AsunaDataTable.tsx - About 1 day to fix

    File model.ts has 490 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { parseJSONIfCould } from '@danielwii/asuna-helper/dist/utils';
    import { ApiResponse } from '@danielwii/asuna-shared';
    
    import { message } from 'antd';
    import { Promise } from 'bluebird';
    Severity: Minor
    Found in src/adapters/model.ts - About 7 hrs to fix

      File columns.tsx has 484 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { LinkOutlined, SearchOutlined } from '@ant-design/icons';
      import { css } from '@emotion/css';
      
      import {
        Badge,
      Severity: Minor
      Found in src/helpers/columns/columns.tsx - About 7 hrs to fix

        File upsert.tsx has 476 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import useLogger from '@danielwii/asuna-helper/dist/logger/hooks';
        
        import * as _ from 'lodash';
        import moment from 'moment';
        import * as R from 'ramda';
        Severity: Minor
        Found in src/modules/content/upsert.tsx - About 7 hrs to fix

          Function TenantWelcome has 153 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const TenantWelcome: React.FC = (props) => {
            const [count, reload] = useState(0);
            const { store } = useContext(StoreContext);
            const { value, error, loading } = useAsync(async () => {
              return Promise.props({
          Severity: Major
          Found in src/tenant/Welcome.tsx - About 6 hrs to fix

            File AsunaDataTable.tsx has 389 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { InfoOutlined, SyncOutlined } from '@ant-design/icons';
            
            import useLogger from '@danielwii/asuna-helper/dist/logger/hooks';
            import { parseJSONIfCould } from '@danielwii/asuna-helper/dist/utils';
            
            
            Severity: Minor
            Found in src/components/AsunaDataTable.tsx - About 5 hrs to fix

              Function AsunaDataTable has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              export const AsunaDataTable: React.FC<AsunaDataTableProps> = (props) => {
                const {
                  creatable = false,
                  editable = false,
                  deletable = false,
              Severity: Minor
              Found in src/components/AsunaDataTable.tsx - About 5 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

              File uploader.tsx has 381 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /** @jsxRuntime classic */
              
              /** @jsx jsx */
              import {
                CloudUploadOutlined,
              Severity: Minor
              Found in src/components/base/uploader/uploader.tsx - About 5 hrs to fix

                Function generate has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                  static async generate(
                    key: string,
                    { model, title, ctx, callRefresh }: ModelOpts,
                    opts: TextColumnOpts = {},
                  ): Promise<ColumnProps<any>> {
                Severity: Minor
                Found in src/helpers/columns/generator.tsx - About 5 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

                File form.tsx has 375 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /** @jsxRuntime classic */
                
                /** @jsx jsx */
                // noinspection ES6UnusedImports
                
                
                Severity: Minor
                Found in src/components/base/easy-form/form.tsx - About 5 hrs to fix

                  File model.spec.ts has 374 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import preloadAll from 'jest-next-dynamic';
                  import { IModelService, ModelAdapterImpl } from './model';
                  import { DynamicFormTypes } from '../components/DynamicForm';
                  import { AppContext, AsunaDefinitions } from '../core/context';
                  import { storeConnector } from '../store';
                  Severity: Minor
                  Found in src/adapters/model.spec.ts - About 5 hrs to fix

                    Function fpGenerateRelation has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                    Open

                        <RelationSchema extends object>(
                          key: string,
                          title: string,
                          opts: {
                            ref?: string;
                    Severity: Minor
                    Found in src/helpers/columns/columns.tsx - About 4 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 Uploader has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const Uploader: React.FC<IUploaderProps> = ({
                      adapter,
                      value,
                      disabled,
                      multiple,
                    Severity: Minor
                    Found in src/components/base/uploader/uploader.tsx - About 4 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

                    File asset-preview.tsx has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /** @jsxRuntime classic */
                    
                    /** @jsx jsx */
                    // noinspection ES6UnusedImports
                    import { FilePdfOutlined } from '@ant-design/icons';
                    Severity: Minor
                    Found in src/components/base/preview-button/asset-preview.tsx - About 4 hrs to fix

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

                      /** @jsxRuntime classic */
                      
                      /** @jsx jsx */
                      // noinspection ES6UnusedImports
                      
                      
                      Severity: Minor
                      Found in src/components/DynamicForm/elements/index.tsx - About 4 hrs to fix

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

                        import { Paper } from '@mui/material';
                        
                        import useLogger from '@danielwii/asuna-helper/dist/logger/hooks';
                        
                        import { Affix, Anchor, Button, Col, Divider, Form, FormInstance, List, Popconfirm, Row, Tag } from 'antd';
                        Severity: Minor
                        Found in src/components/DynamicForm/index.tsx - About 4 hrs to fix

                          Function generate has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            static async generate(
                              key: string,
                              { model, title, ctx, callRefresh }: ModelOpts,
                              opts: TextColumnOpts = {},
                            ): Promise<ColumnProps<any>> {
                          Severity: Major
                          Found in src/helpers/columns/generator.tsx - About 4 hrs to fix

                            Function ListKVComponent has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function ListKVComponent(props: {
                              kvCollection?: string;
                              kvKey: string;
                              // initialState: { body: FormBody | any };
                              enableClear?: boolean;
                            Severity: Major
                            Found in src/components/KV/list.tsx - About 4 hrs to fix

                              Function fpGenerateRelation has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  async (
                                    laterKey: string,
                                    actions: Asuna.Schema.RecordRenderActions,
                                    extras: Asuna.Schema.RecordRenderExtras,
                                  ): Promise<RelationColumnProps> => {
                              Severity: Major
                              Found in src/helpers/columns/columns.tsx - About 3 hrs to fix

                                Function generate has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  generate: async (
                                    key: string,
                                    { model, title, ctx }: ModelOpts,
                                    opts: TextColumnOpts = {},
                                  ): Promise<ColumnProps<any>> => {
                                Severity: Minor
                                Found in src/helpers/index.tsx - About 3 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

                                Severity
                                Category
                                Status
                                Source
                                Language