Function showSearch
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
showSearch(search) {
if (search) {
const rv = {};
const getRV = (pos) => {
if (!rv[pos.roomName]) {
- 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 showCreeps
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
showCreeps() {
for (const room of _.values(Game.rooms)) {
if (!room.isMy()) {
continue;
}
- 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 showCostMatrix
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
showCostMatrix(roomName, costMatrixCallback) {
const rv = new RoomVisual(roomName);
const cm = costMatrixCallback(roomName);
if (cm) {
for (let x = 0; x < 50; ++x) {
- 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 showStructures
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
showStructures() {
for (const room of _.values(Game.rooms)) {
if (!room.isMy()) {
continue;
}
- 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 showBlockers
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
showBlockers() {
for (const room of _.values(Game.rooms)) {
if (!room.isMy()) {
continue;
}
- 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 showBlockers
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
showBlockers() {
for (const room of _.values(Game.rooms)) {
if (!room.isMy()) {
continue;
}
Avoid deeply nested control flow statements. Open
if (target.structureType) {
text = target.structureType.substr(0, 1);
} else {
text = 's'; // source
}
Avoid deeply nested control flow statements. Open
if (creep) {
this.drawPosition(rv, creep, text, 'yellow');
}
Avoid deeply nested control flow statements. Open
if (!structure) {
continue;
}
Function render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (config.visualizer.showCostMatrices) {
this.showCostMatrices();
}
if (config.visualizer.showRoomPaths) {
- 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"