Skip to content

Test scanner#8388

Open
mtwebster wants to merge 5 commits intolinuxmint:masterfrom
mtwebster:test-scanner
Open

Test scanner#8388
mtwebster wants to merge 5 commits intolinuxmint:masterfrom
mtwebster:test-scanner

Conversation

@mtwebster
Copy link
Copy Markdown
Member

testing some more..

@github-actions
Copy link
Copy Markdown
Contributor

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 3 potential issue(s):

⚠️ sync_file_get_contents

claude-usage@mtwebster/files/claude-usage@mtwebster/applet.js:60

const os_release = GLib.file_get_contents("/etc/os-release");

Synchronous file_get_contents() blocks the main loop.
Use Gio.File.load_contents_async() instead.

claude-usage@mtwebster/files/claude-usage@mtwebster/applet.js:90

const tz = GLib.file_get_contents("/etc/timezone");

Synchronous file_get_contents() blocks the main loop.
Use Gio.File.load_contents_async() instead.

⚠️ sync_file_test

claude-usage@mtwebster/files/claude-usage@mtwebster/applet.js:89

if (GLib.file_test("/etc/timezone", GLib.FileTest.EXISTS)) {

file_test() is a synchronous stat call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.


Automated pattern check.

@github-actions
Copy link
Copy Markdown
Contributor

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 4 potential issue(s):

⚠️ sync_file_get_contents

claude-usage@mtwebster/files/claude-usage@mtwebster/applet.js:62

const os_release = GLib.file_get_contents("/etc/os-release");

Synchronous file_get_contents() blocks the main loop.
Use Gio.File.load_contents_async() instead.

claude-usage@mtwebster/files/claude-usage@mtwebster/applet.js:94

const tz = GLib.file_get_contents("/etc/timezone");

Synchronous file_get_contents() blocks the main loop.
Use Gio.File.load_contents_async() instead.

⚠️ sync_file_test

claude-usage@mtwebster/files/claude-usage@mtwebster/applet.js:93

if (GLib.file_test("/etc/timezone", GLib.FileTest.EXISTS)) {

file_test() is a synchronous stat call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

⚠️ generic_container

claude-usage@mtwebster/files/claude-usage@mtwebster/applet.js:64

new Cinnamon.GenericContainer();

(Cinnamon 6.6) Cinnamon.GenericContainer is deprecated. It was a workaround for when
JavaScript classes could not override ClutterActor virtual functions.
Create a GObject subclass of St.Widget (or another container) and override
the vfunc_get_preferred_width, vfunc_get_preferred_height, and
vfunc_allocate methods directly instead.


Automated pattern check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant