Showing 49 of 138 total issues
Avoid too many return
statements within this function. Open
return Promise.all(
items.map(async (item) => {
return apiGatewayManagementApi
.postToConnection({
ConnectionId: item.id,
Avoid too many return
statements within this function. Open
return { message: "no event." };
Avoid too many return
statements within this function. Open
return Promise.all(
items.map(async (item) => {
return apiGatewayManagementApi
.postToConnection({
ConnectionId: item.id,
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return Promise.all(
items.map(async (item) => {
return apiGatewayManagementApi
.postToConnection({
ConnectionId: item.id,
Function SidebarComponent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const SidebarComponent = () => {
const states = useSelector((state: AppState) => state);
const dispatch = useDispatch();
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 authenticate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const authenticate = (req: any, res: any) =>
new Promise((resolve, reject) => {
passport.authenticate("jwt", (err, payload) => {
if (err) reject(err);
if (!payload) reject("not payload");
- 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 getServerSideProps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getServerSideProps = wrapper.getServerSideProps(async context => {
let name = context.query.name;
name = name ? name.toString() : "";
await context.store.dispatch<any>(getItem.action(encodeURI(name)));
const state: AppState = context.store.getState();
- 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 getServerSideProps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getServerSideProps = wrapper.getServerSideProps(async context => {
let name = context.query.name;
name = name ? name.toString() : "";
await context.store.dispatch<any>(getEntry.action(encodeURI(name)));
const state: AppState = context.store.getState();
- 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"