Showing 509 of 1,320 total issues
Consider simplifying this complex logical expression. Open
Open
if (typeof YAHOO.lacuna.buildings.Embassy == "undefined" || !YAHOO.lacuna.buildings.Embassy) {
(function(){
var Lang = YAHOO.lang,
Util = YAHOO.util,
Function getTileData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
getTileData : function(callback, x1, x2, y1, y2) {
Function setOrbits
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
setOrbits : function(minOrbit, maxOrbit, skipAnim, force, silent) {
Function getTileData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
getTileData : function(callback, x1, x2, y1, y2) {
Function ViewData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ViewData : function(id, url, callback, x, y) {
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
render : function() {
// console.log(this.state);
// Do nothing if the menu isn't shown.
- 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 componentDidUpdate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
componentDidUpdate : function() {
if (this.state.chatMenu.show !== this.hasRenderedChat) {
if (this.state.chatMenu.show === true && this.hasRenderedChat === false) {
this.loadChat();
- 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
Open
return Math.floor(number / 1000000000) + 'B';
Avoid too many return
statements within this function. Open
Open
return (Math.floor(number / 100000000) / 10) + 'B';
Avoid too many return
statements within this function. Open
Open
return Math.floor(number / 1000) + 'k';
Avoid too many return
statements within this function. Open
Open
return {"error":{"message":"Response Content-Type is not JSON"}};
Avoid too many return
statements within this function. Open
Open
return Math.floor(number);
Avoid too many return
statements within this function. Open
Open
return Math.floor(number / 1000000) + 'M';
Avoid too many return
statements within this function. Open
Open
return (Math.floor(number / 100000) / 10) + 'M';
Avoid too many return
statements within this function. Open
Open
return Math.floor(number) || '0';
Avoid too many return
statements within this function. Open
Open
return 0;
Avoid too many return
statements within this function. Open
Open
return 0;
Avoid too many return
statements within this function. Open
Open
return 1;
Avoid too many return
statements within this function. Open
Open
return -1;
Avoid too many return
statements within this function. Open
Open
return 1;