src/lib/store.ts
Function Store
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Invalid
Invalid
function Store(plugin_opts: any) {
const tag_count_map: any = {}
function make_tag(store_name: any) {
tag_count_map[store_name] = (tag_count_map[store_name] || 0) + 1
- 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 Store
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
Invalid
function Store(plugin_opts: any) {
const tag_count_map: any = {}
function make_tag(store_name: any) {
tag_count_map[store_name] = (tag_count_map[store_name] || 0) + 1
Function init
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
Invalid
init: function (instance: any, store_opts: any, store: any, cb: any) {
const entspecs = []
if (store_opts.map) {
for (const canon in store_opts.map) {
Function reify_entity_wrap
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Invalid
Invalid
reify_entity_wrap: function (
cmdfunc: any,
cmd: string,
zone?: string,
base?: 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 reify_entity_wrap
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
Invalid
reify_entity_wrap: function (
cmdfunc: any,
cmd: string,
zone?: string,
base?: string,
Function outfunc
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
Invalid
const outfunc = function (this: any, msg: any, reply: any, meta: any) {
if ('save' !== msg.cmd) {
if (null == msg.q) {
msg.q = {}
Function reify_entity_wrap
has 5 arguments (exceeds 4 allowed). Consider refactoring. Invalid
Invalid
cmdfunc: any,
cmd: string,
zone?: string,
base?: string,
name?: string,