Showing 16 of 43 total issues
Function setup
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function setup(store) {
const Adapter = methods({
set(property, value) {
store.actions.updateSubject({
id: this.getId(),
Function setup
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function setup(store, treeId) {
const Adapter = methods({
set(property, value) {
store.actions.updateTreeNode({
nodeId: this.getId(),
Function initialize
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function initialize(Model, select) {
const ModelType = Model.getModelType()
const isModelInstance = (possibleInstance) => (
t.Nil.is(possibleInstance) === false &&
Function setup
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function setup(store) {
const Adapter = methods({
getNodes() {
throw new Error(oneLine`
Collection of nodes of tree cannot be directly read.
Function Model
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Model(ModelType, Adapter) {
const ModelAdapter = methods({
get(property, dataSource) {
const modelData = dataSource()
Function sync
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sync(watchRemote = false) {
invariant(syncedInstances.has(this.chief) === false, oneLine`
The Chief %s is already synced with firebase %s
`, this.chief.id, this.firebaseRef.toString())
Function applySubjectMemory
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applySubjectMemory(subject, memoryId, key, value) {
let result = subject
if (MemoryDictionary.is(subject.memories) === false) {
result = t.update(result, {
Function initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function initialize(Model, select) {
const ModelType = Model.getModelType()
const isModelInstance = (possibleInstance) => (
t.Nil.is(possibleInstance) === false &&
- 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 execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function execute(executionNode, executionContext, executionTick) {
const { memory, status: { ERROR, RUNNING }} = executionContext
if (executeEnter(executionNode, executionContext) === ERROR) {
return ERROR
- 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 buildExecutionTree
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function buildExecutionTree(tree, buildExecutionNode) {
const treeId = tree.getId()
const nodes = tree.listNodes()
const executionNodes = nodes.map(buildExecutionNode)
const executionNodeMap = executionNodes.reduce(convertToNodeMap, {})
- 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 tick
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
tick({ status, memory }, { children }) {
const childrenCount = children.length
let childIndex = memory.get('runningChild') || initialChildIndex
- 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 tick
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
tick({ status, memory }, { children }) {
const childrenCount = children.length
let childIndex = memory.get('runningChild') || initialChildIndex
- 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 initializeMemoryModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function initializeMemoryModel({ store, subjectId, memoryId }) {
invariant(store, oneLine`
Memory model is expecting store instance
`)
- 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
Avoid too many return
statements within this function. Open
return tickStatus
Function planExecution
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function planExecution(toolboxFactory = () => null, onError = log) {
const getExecutionRootNode = ObjectCache(
buildExecutionTree, (tree) => tree.getId(),
)
- 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 tick
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
tick({ status, memory, config }, { child }) {
const { maxLoop } = config
let currentLoop = memory.get('currentLoop')
let resultStatus = status.SUCCESS
- 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"