Showing 217 of 217 total issues
Function InternalSearch
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InternalSearch = (props) => {
const { form, enableLoading, render, content, children, ...others } = props
return <Consumer
form={form}
reducer={(state, action) => {
Function FieldProvider
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FieldProvider: React.FC<any> = (props = {}) => {
const { children, name, connectMode = false, defaultEmptyValue = null, searchOnChange = false } = props
const list = useContext(ListContext)
const { mode } = useContext(FilterModeContext) || {}
const formatName = getFormatName(name)
Identical blocks of code found in 4 locations. Consider refactoring. Open
function buildESM() {
const { fileNames, options } = getCompileConfig(require.resolve('./tsconfig.json'), {
outDir: './esm',
module: ts.ModuleKind.ESNext
})
- Read upRead up
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 77.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 4 locations. Consider refactoring. Open
function buildESM() {
const { fileNames, options } = getCompileConfig(require.resolve('./tsconfig.json'), {
outDir: './esm',
module: ts.ModuleKind.ESNext
})
- Read upRead up
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 77.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 4 locations. Consider refactoring. Open
function buildESM() {
const { fileNames, options } = getCompileConfig(require.resolve('./tsconfig.json'), {
outDir: './esm',
module: ts.ModuleKind.ESNext
})
- Read upRead up
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 77.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 4 locations. Consider refactoring. Open
function buildESM() {
const { fileNames, options } = getCompileConfig(require.resolve('./tsconfig.json'), {
outDir: './esm',
module: ts.ModuleKind.ESNext
})
- Read upRead up
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 77.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function InternalTable
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const InternalTable: InternalTableType = props => {
const { children, columns, ...others } = props
const renderProps: any = {}
if (children) {
renderProps.children = React.Children.map(props.children, (item: 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
Function usePagination
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const usePagination = (props: IPaginationProps = {}, propList?: IList): IPaginationHook => {
const { multipleId: propsMultipleId } = props
const list = propList || useContext(ListContext)
const { id: contextMultipleId } = useContext(MultipleContext) || {}
const multipleId = propsMultipleId || contextMultipleId
- 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 injectFuncs
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const injectFuncs = (props, funcs) => {
if (!props) return props
if (Array.isArray(props)) {
return props.map(item => injectFuncs(item, funcs))
} else if (typeof props === 'object') {
- 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 SchemaSolver
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SchemaSolver = props => {
const {
effects,
actions,
schema,
Function InternalTable
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InternalTable: InternalTableType = props => {
const { children, columns, ...others } = props
const renderProps: any = {}
if (children) {
renderProps.children = React.Children.map(props.children, (item: any) => {
Function useList
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useList = (options: IListUIProps): IList & { actions: any } => {
const optionsRef = useRef<IListUIProps>(options)
const actionsRef = useRef<any>(options.actions)
const listDomain = useContext(ListDomain)
actionsRef.current = actionsRef.current || createListActions()
Function InternalTable
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InternalTable: InternalTableType = props => {
const { onSort = noop, onFilter = noop, ...others } = props
const columns = React.Children.map(props.children, (item: any) => {
if (!item) return item
/* 处理嵌套类的情况 */
Function useConsumer
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useConsumer = (props: IConsumerProps, propsList?: IList): {
list: IList,
type: string,
state: any,
listDomain: ListDomain
Function setRowSelection
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
setRowSelection: (selectionConfig: IListSelectionConfig) => {
actionsRef.current.setSelectionConfig(selectionConfig)
const config = actionsRef.current.getSelectionConfig()
const { className = '' } = actionsRef.current.getTableProps()
if (config) {
Function setRowSelection
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
setRowSelection: (selectionConfig: IListSelectionConfig) => {
actionsRef.current.setSelectionConfig(selectionConfig)
const config = actionsRef.current.getSelectionConfig()
const { className = '' } = actionsRef.current.getTableProps()
if (config) {
Function getFilterEffects
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getFilterEffects = props => {
const noop = () => {}
const { effects = noop } = props || {}
return ($, actions) => {
// 搜索区域初始化完成
Function renderSchema
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const renderSchema = (props, contextProps) => {
const { effects, actions, funcRegistry, componentsRegistry } = contextProps
const { children, componentName, props: componentProps } = props
const schemaResult = {
- 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 useLoading
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const useLoading = (props: ITableProps = {}, propList?: IList): ILoadingHook => {
const { multipleId: propsMultipleId } = props
const list = propList || useContext(ListContext)
const { id: contextMultipleId } = useContext(MultipleContext) || {}
const multipleId = propsMultipleId || contextMultipleId
- 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 setRowSelection
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
setRowSelection: (selectionConfig: IListSelectionConfig) => {
actionsRef.current.setSelectionConfig(selectionConfig)
const config = actionsRef.current.getSelectionConfig()
const { className = '', primaryKey: defaultPrimaryKey } = actionsRef.current.getTableProps()
if (config) {