src/redux/actions/adminApps.js
Function getAppsList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
const getAppsList = (page,keyword='') => async (dispatch) => {
dispatch(startGettingApps());
// try {
// const response = await axios.get(`/apps?page=${page}`);
// return dispatch(getAppsSuccess(response));
- 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
Parsing error: require() of ES Module /usr/local/node_modules/eslint/node_modules/eslint-scope/lib/definition.js from /usr/local/node_modules/babel-eslint/lib/require-from-eslint.js not supported.
Instead change the require of definition.js in /usr/local/node_modules/babel-eslint/lib/require-from-eslint.js to a dynamic import() which is available in all CommonJS modules. Open
Open
import axios from "../../axios";
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/