HaxePunk/HaxePunk

View on GitHub

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;
Severity: Minor
Found in doc/theme/resources/index.js - About 1 hr to fix

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");
Severity: Minor
Found in doc/theme/resources/index.js - About 1 hr to fix

    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;
    Severity: Minor
    Found in doc/theme/resources/index.js - About 1 hr to fix

      Missing package declaration
      Open

      import haxepunk.Engine;

      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
      Severity: Info
      Found in haxepunk/HXP.hx by haxe-checkstyle

      Enforces a style for nullable parameters.

      Too many consecutive empty lines (> 1)
      Open

      
      
      Severity: Minor
      Found in haxepunk/Scene.hx by haxe-checkstyle

      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;
      Severity: Info
      Found in haxepunk/Scene.hx by haxe-checkstyle

      Checks for unused or duplicate imports.

      Detected import haxepunk.graphics.atlas.AtlasData from same package haxepunk.graphics.atlas
      Open

      import haxepunk.graphics.atlas.AtlasData;

      Checks for unused or duplicate imports.

      Detected import haxepunk.utils.BlendMode from same package haxepunk.utils
      Open

      import haxepunk.utils.BlendMode;
      Severity: Info
      Found in haxepunk/utils/Draw.hx by haxe-checkstyle

      Checks for unused or duplicate imports.

      No space around +
      Open

                  pos.y = points[index+1];

      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;

      Checks for unused or duplicate imports.

      Missing package declaration
      Open

      import neko.Lib;
      Severity: Info
      Found in tools/CLI.hx by haxe-checkstyle

      Checks for empty package names.

      Left curly should be on new line (only whitespace before curly)
      Open

          public static function main() { new Main(); }

      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;
      Severity: Info
      Found in haxepunk/Tweener.hx by haxe-checkstyle

      Checks for unused or duplicate imports.

      Left curly should be on new line (only whitespace before curly)
      Open

              currentAnimation.may(function(anim) {

      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;

      Checks for unused or duplicate imports.

      Unused import haxepunk.HXP detected
      Open

      import haxepunk.HXP;
      Severity: Info
      Found in haxepunk/input/Gamepad.hx by haxe-checkstyle

      Checks for unused or duplicate imports.

      No space between catch and (
      Open

              catch(e:String)
      Severity: Minor
      Found in tools/CLI.hx by haxe-checkstyle

      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(); }

      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;

      Checks indentation character (tab/space, default is tab).

      Severity
      Category
      Status
      Source
      Language