Method _setup
length is 55 lines (max allowed is 50) Open
function _setup() {
renderer.view.style.transform = "translatez(0)";
maxX = Browser.window.innerWidth;
maxY = Browser.window.innerHeight;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for long methods. If a method becomes very long it is hard to understand. Therefore long methods should usually be refactored into several individual methods that focus on a specific task.
37
is a magic number Open
var bunny2 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 86, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
164
is a magic number Open
var bunny4 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 164, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
200000
is a magic number Open
container = new ParticleContainer(200000, [false, true, false, false, false]);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
47
is a magic number Open
var bunny1 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 47, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
26
is a magic number Open
var bunny2 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 86, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
26
is a magic number Open
var bunny4 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 164, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
0.5
is a magic number Open
bunny.scale.set(0.5 + Math.random() * 0.5, 0.5 + Math.random() * 0.5);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
5
is a magic number Open
bunny.speedY = (Math.random() * 5) - 3;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
0.5
is a magic number Open
if (Math.random() > 0.5) bunny.speedY -= Math.random() * 6;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
125
is a magic number Open
var bunny3 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 125, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
37
is a magic number Open
var bunny3 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 125, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
3
is a magic number Open
bunny.speedY = (Math.random() * 5) - 3;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
0.5
is a magic number Open
bunny.rotation = (Math.random() - 0.5);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
5
is a magic number Open
bunny.speedX = Math.random() * 5;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
0.5
is a magic number Open
bunny.scale.set(0.5 + Math.random() * 0.5, 0.5 + Math.random() * 0.5);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
6
is a magic number Open
if (Math.random() > 0.5) bunny.speedY -= Math.random() * 6;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
37
is a magic number Open
var bunny1 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 47, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
0.5
is a magic number Open
var gravity:Float = 0.5;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
0x8BDDCE
is a magic number Open
backgroundColor = 0x8BDDCE;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
86
is a magic number Open
var bunny2 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 86, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
200000
is a magic number Open
if (count < 200000) {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
3
is a magic number Open
bunny.speedY = (Math.random() * 5) - 3;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
5
is a magic number Open
bunny.speedX = Math.random() * 5;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
5
is a magic number Open
bunny.speedY = (Math.random() * 5) - 3;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
26
is a magic number Open
var bunny5 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 2, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
5
is a magic number Open
bunnyType %= 5;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
-0.85
is a magic number Open
bunny.speedY *= -0.85;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
37
is a magic number Open
var bunny5 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 2, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
0.5
is a magic number Open
bunny.anchor.x = 0.5;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
0.5
is a magic number Open
bunny.scale.set(0.5 + Math.random() * 0.5, 0.5 + Math.random() * 0.5);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
26
is a magic number Open
var bunny1 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 47, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
26
is a magic number Open
var bunny3 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 125, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
37
is a magic number Open
var bunny4 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 164, 26, 37));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
0.5
is a magic number Open
bunny.scale.set(0.5 + Math.random() * 0.5, 0.5 + Math.random() * 0.5);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.
Invalid variable bunnyTextures
initialisation (move initialisation to constructor or function) Open
var bunnyTextures:Array<Texture> = [];
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for instance variables that are initialised at class level.
Invalid variable amount
initialisation (move initialisation to constructor or function) Open
var amount:Int = 100;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for instance variables that are initialised at class level.
Invalid variable minY
initialisation (move initialisation to constructor or function) Open
var minY:Float = 0;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for instance variables that are initialised at class level.
Invalid variable gravity
initialisation (move initialisation to constructor or function) Open
var gravity:Float = 0.5;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for instance variables that are initialised at class level.
Invalid variable bunnys
initialisation (move initialisation to constructor or function) Open
var bunnys:Array<Bunny> = [];
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for instance variables that are initialised at class level.
Invalid variable isAdding
initialisation (move initialisation to constructor or function) Open
var isAdding:Bool = false;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for instance variables that are initialised at class level.
Invalid variable startBunnyCount
initialisation (move initialisation to constructor or function) Open
var startBunnyCount:Int = 2;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for instance variables that are initialised at class level.
Invalid variable minX
initialisation (move initialisation to constructor or function) Open
var minX:Float = 0;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for instance variables that are initialised at class level.
Invalid variable count
initialisation (move initialisation to constructor or function) Open
var count:Int = 0;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for instance variables that are initialised at class level.
Invalid member signature: startBunnyCount
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var startBunnyCount:Int = 2;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: isAdding
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var isAdding:Bool = false;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: container
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var container:ParticleContainer;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: minX
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var minX:Float = 0;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: maxY
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var maxY:Float;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: bunnyTextures
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var bunnyTextures:Array<Texture> = [];
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid method name signature: main
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
static function main() {
new Main();
}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that method names conform to a format specified by the format
property.
Invalid member signature: maxX
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var maxX:Float;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: bunnyType
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var bunnyType:Int;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: bunnys
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var bunnys:Array<Bunny> = [];
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid method name signature: onTouchEnd
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
function onTouchEnd(event) {
bunnyType++;
bunnyType %= 5;
currentTexture = bunnyTextures[bunnyType];
isAdding = false;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that method names conform to a format specified by the format
property.
Invalid member signature: minY
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var minY:Float = 0;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: count
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var count:Int = 0;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: wabbitTexture
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var wabbitTexture:Texture;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: amount
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var amount:Int = 100;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: currentTexture
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var currentTexture:Texture;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid member signature: counter
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var counter:DivElement;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.
Invalid method name signature: onTouchStart
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
function onTouchStart(event) {
isAdding = true;
}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that method names conform to a format specified by the format
property.
Invalid member signature: gravity
(name should be ~/^_[a-z][a-zA-Z0-9]*$/
) Open
var gravity:Float = 0.5;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that instance variable names conform to a format specified by the format
property.