Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
const out: string[] = [];
let i = 0;
let lineStart = true;
let pending = "";
const pending = "";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 | Confidence: Medium

The let pending = "" was changed to const pending = "" as a CodeFactor lint fix. The visible changed region at lines 82–93 shows only the declaration and the adjacent push helper, which does not reassign pending. However, the remainder of the function body is not present in the supplied exact-head evidence. If any later statement does pending = or pending +=, this conversion becomes a type/runtime regression. Current-head CI reports success, but no supplied evidence identifies whether those checks type-check this full function body. Therefore the source-level fact remains unresolved.

Owner action: Read the full formatJsCode function body at PR head to confirm pending is never reassigned; if it is, revert to let or remove the variable.

Evidence: bounded PR-head context from artifacts/personal-tool-console/src/components/tools/coding-tools.tsx.


const push = (s: string) => {
for (const ch of s) {
Expand Down Expand Up @@ -309,7 +309,7 @@
transform={(s) =>
formatHtml(s)
.split("\n")
.map((l) => (indent === "4" ? l.replace(/^( )/g, " ") : l))
.map((l) => (indent === "4" ? l.replace(/^( {2})/g, " ") : l))

Check warning on line 312 in artifacts/personal-tool-console/src/components/tools/coding-tools.tsx

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

artifacts/personal-tool-console/src/components/tools/coding-tools.tsx#L312

This regular expression is missing the u or v flag.
.join("\n")
}
/>
Expand Down
2 changes: 1 addition & 1 deletion artifacts/personal-tool-console/src/lib/tools/coding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export function formatCss(css: string): string {
const tokens = noComments.replace(/([{};])/g, "$1\n").split("\n");
let indent = 0;
const lines: string[] = [];
for (let raw of tokens) {
for (const raw of tokens) {
const line = raw.trim();
if (!line) continue;
if (line.startsWith("}")) indent = Math.max(0, indent - 1);
Expand Down
Loading