Showing 149 of 149 total issues
Function setPlatform
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function setPlatform(platform) {
selectItem("platform", platform);
var styles = ".platform { display:none }";
var platforms = dox.platforms;
- 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 searchQuery
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function searchQuery(query) {
query = query.toLowerCase();
$("#searchForm").removeAttr("action");
if (query == "") {
$("#nav").removeClass("searching");
Function setPlatform
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setPlatform(platform) {
selectItem("platform", platform);
var styles = ".platform { display:none }";
var platforms = dox.platforms;
Missing package declaration Open
import haxepunk.Engine;
- Read upRead up
- Exclude checks
Checks for empty package names.
Function parameter options = null
should be ?options
Open
public static function tween(object:Dynamic, values:Dynamic, duration:Float, options:Dynamic = null):MultiVarTween
- Read upRead up
- Exclude checks
Enforces a style for nullable parameters.
Too many consecutive empty lines (> 1) Open
- Read upRead up
- Exclude checks
Checks for consecutive empty lines (default is 1). Also have options to check empty line separators after package, single-line and multi-line comments and class/interface/abstract declarations.
Detected import haxepunk.Signal
from same package haxepunk
Open
import haxepunk.Signal;
- Read upRead up
- Exclude checks
Checks for unused or duplicate imports.
Detected import haxepunk.graphics.atlas.AtlasData
from same package haxepunk.graphics.atlas
Open
import haxepunk.graphics.atlas.AtlasData;
- Read upRead up
- Exclude checks
Checks for unused or duplicate imports.
Detected import haxepunk.utils.BlendMode
from same package haxepunk.utils
Open
import haxepunk.utils.BlendMode;
- Read upRead up
- Exclude checks
Checks for unused or duplicate imports.
No space around +
Open
pos.y = points[index+1];
- Read upRead up
- Exclude checks
Spacing check on if, for, while, switch, try statements and around operators.
Detected import haxepunk.utils.BlendMode
from same package haxepunk.utils
Open
import haxepunk.utils.BlendMode;
- Read upRead up
- Exclude checks
Checks for unused or duplicate imports.
Missing package declaration Open
import neko.Lib;
- Read upRead up
- Exclude checks
Checks for empty package names.
Left curly should be on new line (only whitespace before curly) Open
public static function main() { new Main(); }
- Read upRead up
- Exclude checks
Checks for the placement of left curly braces ({
) for code blocks. The policy to verify is specified using the property option
.
Detected import haxepunk.Tween
from same package haxepunk
Open
import haxepunk.Tween;
- Read upRead up
- Exclude checks
Checks for unused or duplicate imports.
Left curly should be on new line (only whitespace before curly) Open
currentAnimation.may(function(anim) {
- Read upRead up
- Exclude checks
Checks for the placement of left curly braces ({
) for code blocks. The policy to verify is specified using the property option
.
Unused import haxe.io.Input
detected Open
import haxe.io.Input;
- Read upRead up
- Exclude checks
Checks for unused or duplicate imports.
Unused import haxepunk.HXP
detected Open
import haxepunk.HXP;
- Read upRead up
- Exclude checks
Checks for unused or duplicate imports.
No space between catch
and (
Open
catch(e:String)
- Read upRead up
- Exclude checks
Spacing check on if, for, while, switch, try statements and around operators.
Left curly should be on new line (only whitespace before curly) Open
public static function main() { new Main(); }
- Read upRead up
- Exclude checks
Checks for the placement of left curly braces ({
) for code blocks. The policy to verify is specified using the property option
.
Wrong indentation character (should be tab) Open
if (_shake > 1) --_shake;
- Read upRead up
- Exclude checks
Checks indentation character (tab/space, default is tab).