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,
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';
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,
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';
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({
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';
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,
- Read upRead up
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,
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>> {
- Read upRead up
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
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';
Function fpGenerateRelation
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
<RelationSchema extends object>(
key: string,
title: string,
opts: {
ref?: string;
- Read upRead up
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,
- Read upRead up
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';
File index.tsx
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @jsxRuntime classic */
/** @jsx jsx */
// noinspection ES6UnusedImports
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';
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>> {
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;
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> => {
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>> => {
- Read upRead up
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"