Showing 126 of 199 total issues
Avoid too many return
statements within this function. Open
return state;
Avoid too many return
statements within this function. Open
return {
..._.omit(state, placeholderId),
[action.payload.mdoc._id]: '',
};
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return {
...state,
isPosting: false,
};
Avoid too many return
statements within this function. Open
return state;
Avoid too many return
statements within this function. Open
return {
...state,
[placeholderId]: false,
};
Avoid too many return
statements within this function. Open
return {
...state,
isPosting: false,
};
Avoid too many return
statements within this function. Open
return next(iter(setting.range))
Avoid too many return
statements within this function. Open
return {
...state,
[placeholderId]: true,
};
Avoid too many return
statements within this function. Open
return {
...state,
records: {
...state.records,
isLoading: false,
Avoid too many return
statements within this function. Open
return {
...state,
[id]: false,
};
Avoid too many return
statements within this function. Open
return state;
Avoid too many return
statements within this function. Open
return setting.factory()
Avoid too many return
statements within this function. Open
return {
...state,
[id]: {
...state[id],
reply: [
Avoid too many return
statements within this function. Open
return {
..._.omit(state, placeholderId),
[action.payload.mdoc._id]: false,
};
Function request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
pjax.request = async opt => {
const options = {
method: 'get',
push: true,
...opt,
- 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 detachAll
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static detachAll(container = document.body) {
const selector = this.DOMDetachSelector || this.DOMAttachSelector;
if (process.env.NODE_ENV !== 'production') {
if (!selector) {
// eslint-disable-next-line quotes
- 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 mapDispatchToProps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const mapDispatchToProps = dispatch => ({
handleChange(id, value) {
if (id === null) {
return;
}
- 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 scrollToViewport
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function scrollToViewport() {
const BOUND_TOP = 60;
const BOUND_BOTTOM = 20;
const node = $('.messagepad')[0];
if (node.offsetHeight + BOUND_TOP + BOUND_BOTTOM < window.innerHeight) {
- 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"