Showing 8 of 8 total issues
Function registerModule
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerModule (store, moduleName) {
store.registerModule(moduleName, {
namespaced: true,
state: createInitialState(store.state[moduleName]),
Function registerModule
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function registerModule (store, moduleName) {
store.registerModule(moduleName, {
namespaced: true,
state: createInitialState(store.state[moduleName]),
- 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 attachMethods
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function attachMethods (context, store, moduleName, key, queue) {
const syncQueue = queue || []
context.thenSync = function thenSync (onFulfilled, onRejected) {
if (!context.isPending) {
- 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
File index.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
const MODULE_NAME = 'promise'
function raise (message) {
throw new Error(`[vue-vuex-promise-store] ${message}`)
}
Function attachMethods
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function attachMethods (context, store, moduleName, key, queue) {
const syncQueue = queue || []
context.thenSync = function thenSync (onFulfilled, onRejected) {
if (!context.isPending) {
Function thenSync
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
context.thenSync = function thenSync (onFulfilled, onRejected) {
if (!context.isPending) {
let ok
let result
Function updateContext
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function updateContext (context, isFulfilled, value, syncQueue) {
context.isPending = false
if (isFulfilled) {
context.isFulfilled = true
- 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 attachMethods
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function attachMethods (context, store, moduleName, key, queue) {