Fix code quality violations and rename select input components
Move small tasks from wishlist to todo, update npm packages Replace #[Auth] attributes with manual auth checks and code quality rule Remove on_jqhtml_ready lifecycle method from framework Complete ACL system with 100-based role indexing and /dev/acl tester WIP: ACL system implementation with debug instrumentation Convert rsx:check JS linting to RPC socket server Clean up docs and fix $id→$sid in man pages, remove SSR/FPC feature Reorganize wishlists: priority order, mark sublayouts complete, add email Update model_fetch docs: mark MVP complete, fix enum docs, reorganize Comprehensive documentation overhaul: clarity, compression, and critical rules Convert Contacts/Projects CRUD to Model.fetch() and add fetch_or_null() Add JS ORM relationship lazy-loading and fetch array handling Add JS ORM relationship fetching and CRUD documentation Fix ORM hydration and add IDE resolution for Base_* model stubs Rename Json_Tree_Component to JS_Tree_Debug_Component and move to framework Enhance JS ORM infrastructure and add Json_Tree class name badges 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\RSpade\CodeQuality\Rules\JavaScript;
|
||||
|
||||
use App\RSpade\CodeQuality\Rules\CodeQualityRule_Abstract;
|
||||
use App\RSpade\CodeQuality\Support\Js_CodeQuality_Rpc;
|
||||
|
||||
/**
|
||||
* JavaScript 'this' Usage Rule
|
||||
@@ -94,8 +95,7 @@ class ThisUsage_CodeQualityRule extends CodeQualityRule_Abstract
|
||||
}
|
||||
|
||||
/**
|
||||
* Use Node.js with acorn to parse JavaScript and find violations
|
||||
* Uses external parser script stored in resources directory
|
||||
* Analyze JavaScript file for 'this' usage violations via RPC server
|
||||
*/
|
||||
private function parse_with_acorn(string $file_path): array
|
||||
{
|
||||
@@ -125,33 +125,8 @@ class ThisUsage_CodeQualityRule extends CodeQualityRule_Abstract
|
||||
}
|
||||
}
|
||||
|
||||
// Path to the parser script
|
||||
$parser_script = __DIR__ . '/resource/this-usage-parser.js';
|
||||
|
||||
if (!file_exists($parser_script)) {
|
||||
// Parser script missing - fatal error
|
||||
throw new \RuntimeException("JS-THIS parser script missing: {$parser_script}");
|
||||
}
|
||||
|
||||
// Run Node.js parser with the external script
|
||||
$output = shell_exec("cd /tmp && node " . escapeshellarg($parser_script) . " " . escapeshellarg($file_path) . " 2>&1");
|
||||
|
||||
if (!$output) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$result = json_decode($output, true);
|
||||
if (!$result) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Check for errors from the parser
|
||||
if (isset($result['error'])) {
|
||||
// Parser encountered an error but it's not fatal for the rule
|
||||
return [];
|
||||
}
|
||||
|
||||
$violations = $result['violations'] ?? [];
|
||||
// Analyze via RPC server (lazy starts if not running)
|
||||
$violations = Js_CodeQuality_Rpc::analyze_this($file_path);
|
||||
|
||||
// Cache the result
|
||||
file_put_contents($cache_file, json_encode($violations));
|
||||
|
||||
Reference in New Issue
Block a user