Showing 11 of 72 total issues
Function calculateAlphaPoints
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
function calculateAlphaPoints(){
for(let i=1;i<wolves.length;i++)
{
//age, diseases, anatomic sizes, marks, characteristics,
let alphaP=100;
- 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 calculateAlphaPoints
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function calculateAlphaPoints(){
for(let i=1;i<wolves.length;i++)
{
//age, diseases, anatomic sizes, marks, characteristics,
let alphaP=100;
Function hunt
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
static hunt(){
if(currentPreyScoutStatus)
{simulationLogs.push(new simulationLog(currentDate,"Hunt", "Wolf pack is on the prowl according to their scout activity findings."));
if(currentPreyCount>=1){
simulationLogs.push(new simulationLog(currentDate,"Hunt", "Wolf pack has found the prey/prey group. Engaging now."));
- 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 calculateBiomeBasedHuntSuccesChance
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function calculateBiomeBasedHuntSuccesChance(){
for(let i=1;i<wolves.length;i++)
{
- 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 regularTrigger
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function regularTrigger(){
simulationLogs.push(new simulationLog(new simulationLog(currentDate,"Simulation","Simulation has started")));
let bookmarkStart=0;
for(let i=1;i<10;i++){
- 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 hunt
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static hunt(){
if(currentPreyScoutStatus)
{simulationLogs.push(new simulationLog(currentDate,"Hunt", "Wolf pack is on the prowl according to their scout activity findings."));
if(currentPreyCount>=1){
simulationLogs.push(new simulationLog(currentDate,"Hunt", "Wolf pack has found the prey/prey group. Engaging now."));
Function calculateBiomeBasedHuntSuccesChance
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function calculateBiomeBasedHuntSuccesChance(){
for(let i=1;i<wolves.length;i++)
{
Function regularTrigger
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function regularTrigger(){
simulationLogs.push(new simulationLog(new simulationLog(currentDate,"Simulation","Simulation has started")));
let bookmarkStart=0;
for(let i=1;i<10;i++){
Avoid deeply nested control flow statements. Open
if(environment.preyType===keys[i]){
return values[i];
}
Function scouting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static scouting(){
let roll=chance.integer({min:0,max:100});//0 and 100 included in range
//%25 chance to encounter wildcard wolves.
//%75 chance to track and find preys
//%20 chance to encounter predators
- 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 calculateActiveClimateBasedBiasHuntChance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function calculateActiveClimateBasedBiasHuntChance(){
if(currentWeatherEvent==="tornado"){
activeClimateBasedBiasHuntChance=0;
}
- 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"