Showing 509 of 1,320 total issues
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render : function() {
return (
<div style={{
paddingBottom : 5,
display : 'inline-block'
Function indexOf
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
Array.prototype.indexOf = function(elt /*, from*/) {
var len = this.length >>> 0;
var from = Number(arguments[1]) || 0;
from = (from < 0) ? Math.ceil(from) : Math.floor(from);
- 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 _getViewTab
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_getViewTab : function() {
var tab = new YAHOO.widget.Tab({ label: "View Glyphs", content: [
'<div class="clearafter">',
' <div class="archaeologySlots">',
' <label>Available Glyphs</label>',
Function getSpeciesData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getSpeciesData : function() {
var data = {
name: this.elName.value,
description: this.elDesc.value.substr(0,1024),
min_orbit: this.speciesHO.getMinOrbit(),
Function build
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
build: function() {
this.id = "Announce";
var container = document.createElement("div");
container.id = this.id;
Function populateOneForOneHave
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
populateOneForOneHave : function() {
var elm = Dom.get("transporterOneForOneHave"),
opt = document.createElement("option"),
nOpt, optGroup;
Function _createPanel
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createPanel : function() {
if(!this.Panel) {
var container = document.createElement("div");
container.id = this.id;
Dom.addClass(container, Lib.Styles.HIDDEN);
Function ShipRecall
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ShipRecall : function(e, matchedEl, container) {
matchedEl.disabled = true;
require('js/actions/menu/loader').show();
this.Self.service.recall_ship({
Function PopulateBodiesForStar
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
PopulateBodiesForStar : function(e) {
var starId = Lib.getSelectedOptionValue(this.starElement),
bodyList = Dom.get(this.bodyElement);
require('js/actions/menu/loader').show()
Function Build
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Build : function(building, x, y) {
if(this.NotIsolationist(building)) {
return;
}
Function Rename
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Rename : function() {
var newName = Dom.get("planetDetailNewName").value;
Game.Services.Body.rename({
session_id: Game.GetSession(""),
body_id:this.selectedBody.id,
Function RenameUninhabited
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
RenameUninhabited: function(e) {
var button = Event.getTarget(e),
body = Lib.getSelectedOptionValue('proposeRenameUninhabitedName'),
newName = Dom.get('proposeRenameUninhabitedNewName').value;
Function ShipBuild
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ShipBuild : function(e) {
var btn = Event.getTarget(e);
btn.disabled = true;
require('js/actions/menu/loader').show();
var qty = Dom.get("ship_"+this.Type);
Function _updateDirty
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_updateDirty : function() {
//only update dirty if it's not a select
if(!this._singleRequest) {
var isDirty;
if(this.multiSelect){
Function RenameAsteroid
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
RenameAsteroid: function(e) {
var button = Event.getTarget(e),
body = Lib.getSelectedOptionValue('proposeRenameAsteroidName'),
newName = Dom.get('proposeRenameAsteroidNewName').value;
Function ShipSend
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ShipSend : function() {
var oSelf = this.Self,
ship = this.Ship,
target, targetName, panel;
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render : function() {
return (
<div
id="sidebarContainer"
style={{
Function MaxValue
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
MaxValue : function(e) {
var btn = Event.getTarget(e),
input = btn.input,
cp = Game.GetCurrentPlanet(),
origVal, newVal;
Function getTravel
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getTravel : function(e) {
if(e.newValue) {
if(!this.shipsTravelling) {
require('js/actions/menu/loader').show();
this.service.view_ships_travelling({session_id:Game.GetSession(),building_id:this.building.id,page_number:1}, {
Function getShips
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getShips : function(e) {
if(e.newValue) {
if(!this.shipsView) {
require('js/actions/menu/loader').show();
this.service.view_all_ships({session_id:Game.GetSession(),building_id:this.building.id,paging:{page_number:1}}, {