package checkstyle.checks.imports; @name("AvoidStarImport") @desc("Checks for import statements that use the * notation and using directives.") class AvoidStarImportCheck extends Check { public function new() { super(TOKEN); categories = [Category.STYLE, Category.CLARITY]; points = 2; } override function actualRun() { var root:TokenTree = checker.getTokenTree(); checkImports(root.filter([Kwd(KwdImport)], ALL)); } function checkImports(importEntries:Array) { for (entry in importEntries) { var stars:Array = entry.filter([Binop(OpMult)], ALL); if (stars.length <= 0) continue; logPos('Using the ".*" form of import should be avoided', entry.pos); } } }