Showing 170 of 3,578 total issues
Function Table
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Table = <T,>({
columns,
data,
title,
footer,
- 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 ValueItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
(hiddenColumns: PropertySchema[], isOpen: boolean, closeFunction: () => void) => () => (
<span className="columns-hint" onClick={closeFunction}>
{isOpen ? <Icon icon="times" /> : <Icon icon="bars" rotation={90} />}
{hiddenColumns.length ? `${hiddenColumns.length} ` : ''}
<Translate>{hiddenColumns.length ? 'columns hidden' : 'Hide columns'}</Translate>
- 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 extendSelect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const extendSelect = select => {
if (!select) {
return select;
}
if (typeof select === '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 referencesReducer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function referencesReducer(state = initialState, action = {}) {
if (action.type === types.SET_REFERENCES) {
return Immutable.fromJS(action.references);
}
- 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 multiselectFilter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const multiselectFilter = (filter, path = 'metadata') => {
const filterValue = filter.value;
const { values = [] } = filterValue;
let match;
if (values.includes('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 nestedTranslationContextDBO
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
(idMapper: idMapperFunction) =>
(label?: string, type?: TranslationDBO['context']['type']): TranslationDBO['context'] => ({
id: label ? idMapper(label).toString() : 'System',
type: label ? type || 'Thesaurus' : 'Uwazi UI',
label: label || 'User Interface',
- 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 confirmAndSaveTemplate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
confirmAndSaveTemplate(
template: TemplateSchema,
confirmationKey: 'templateConflict' | 'largeNumberOfEntities'
) {
return this.props.mainContext.confirm({
- 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 ProtectedRoute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ProtectedRoute = ({
children,
onlyAdmin,
}: {
children: ReactElement;
- 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 ImportButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ImportButton = ({
onSuccess,
onFailure,
thesaurus,
}: {
- 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 DropdownMenu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const DropdownMenu = ({ link, position, hideMobileMenu }: DropdownMenuProps) => {
const [showing, setShowing] = useState(false);
const dropdownRef = useRef(null);
const onClickOutside = useCallback(() => {
setShowing(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"