Power Platform QA Solution
Power Platform QA
Home
Solutions
Reports
Settings
User Guide
Back to Analyzers
Configure Analyzer —
Screen Control Counter
CUSTOM
Metadata
ID
screen-control-count
Result Key
screenControlCount
File
screen-control-count.js
Built-in
No
Analyzer Classification
Category
— This determines the type of Analyzer you are building. Categories can be set up under settings.
Uncategorized
Performance
Data Operations
Variables & Scoping
Maintenance
Test sets
— Include this analyzer in predefined runs. Select one or more test sets this analyzer should belong to.
Dataverse test set
Some tests
Description
Detects screens with an excessive number of controls. Reports screens with 200 or more controls as medium severity and screens with 300 or more controls as high severity.
Prompt
Provider
Anthropic (Claude) — no key
OpenAI (GPT) — no key
Google (Gemini) — no key
Re-run AI builder
Report all screens that have 200 or more controls on them with a medium status issue and report all Screens with more than 300 controls as a High status issue.
Source Code
screen-control-count.js ·
Input data reference ↗
Checking…
Save JavaScript
export default { name: "Screen Control Count", description: "Detects screens with an excessive number of controls. Reports screens with 200 or more controls as medium severity and screens with 300 or more controls as high severity.", resultKey: "screenControlCount", resultSchema: { keys: [ { key: "name", label: "Screen Name", suggestedFormat: "name-copy" }, { key: "type", label: "Issue Type", suggestedFormat: "deadcode-type" }, { key: "controlCount", label: "Control Count", suggestedFormat: "numeric" }, { key: "threshold", label: "Threshold Exceeded", suggestedFormat: "badge-info" }, { key: "confidence", label: "Severity", suggestedFormat: "badge-confidence" }, { key: "message", label: "Details", suggestedFormat: "truncate:120" }, { key: "locations", label: "Locations", suggestedFormat: "locations" }, { key: "abc", label: "Locations", suggestedFormat: "locations" } ] }, analyze(controlTree, refGraph, extraction) { const results = []; function countDescendants(node) { let count = 0; if (!node.children || node.children.length === 0) return 0; for (const child of node.children) { count += 1 + countDescendants(child); } return count; } for (const screen of controlTree.screens) { const controlCount = countDescendants(screen); if (controlCount >= 300) { results.push({ name: screen.name, type: "excessive-controls-high", controlCount, threshold: ">= 300 controls", confidence: "high", message: `Screen "${screen.name}" contains ${controlCount} controls, which far exceeds the recommended limit of 300. This is likely to cause significant performance degradation, slow load times, and memory pressure.`, locations: [ { control: screen.name, property: null, file: screen.filePath || null, snippet: null } ] }); } else if (controlCount >= 200) { results.push({ name: screen.name, type: "excessive-controls-medium", controlCount, threshold: ">= 200 controls", confidence: "medium", message: `Screen "${screen.name}" contains ${controlCount} controls, which exceeds the recommended limit of 200. Consider breaking this screen into multiple screens or using components to reduce complexity.`, locations: [ { control: screen.name, property: null, file: screen.filePath || null, snippet: null } ] }); } } results.sort((a, b) => b.controlCount - a.controlCount); return results; } };
Report Output Columns
Columns shown in the generated report. Toggle off to hide; pick a declared key or use "Custom…" for dot-paths like
locations.0.file
.
+ Add column
Enabled
Key
Label
Format
Width
name
Plain text
Small text
Muted grey text
Code snippet
Number (right-aligned)
Percentage (%)
Truncate at 80 chars
Truncate at 120 chars
Info pill (blue)
Confidence pill (red/yellow/grey)
Dead-code type pill
Bold name + copy button
Locations list
×
type
Plain text
Small text
Muted grey text
Code snippet
Number (right-aligned)
Percentage (%)
Truncate at 80 chars
Truncate at 120 chars
Info pill (blue)
Confidence pill (red/yellow/grey)
Dead-code type pill
Bold name + copy button
Locations list
×
controlCount
Plain text
Small text
Muted grey text
Code snippet
Number (right-aligned)
Percentage (%)
Truncate at 80 chars
Truncate at 120 chars
Info pill (blue)
Confidence pill (red/yellow/grey)
Dead-code type pill
Bold name + copy button
Locations list
×
threshold
Plain text
Small text
Muted grey text
Code snippet
Number (right-aligned)
Percentage (%)
Truncate at 80 chars
Truncate at 120 chars
Info pill (blue)
Confidence pill (red/yellow/grey)
Dead-code type pill
Bold name + copy button
Locations list
×
confidence
Plain text
Small text
Muted grey text
Code snippet
Number (right-aligned)
Percentage (%)
Truncate at 80 chars
Truncate at 120 chars
Info pill (blue)
Confidence pill (red/yellow/grey)
Dead-code type pill
Bold name + copy button
Locations list
×
message
Plain text
Small text
Muted grey text
Code snippet
Number (right-aligned)
Percentage (%)
Truncate at 80 chars
Truncate at 120 chars
Info pill (blue)
Confidence pill (red/yellow/grey)
Dead-code type pill
Bold name + copy button
Locations list
×
locations
Plain text
Small text
Muted grey text
Code snippet
Number (right-aligned)
Percentage (%)
Truncate at 80 chars
Truncate at 120 chars
Info pill (blue)
Confidence pill (red/yellow/grey)
Dead-code type pill
Bold name + copy button
Locations list
×
Cancel
Test analyzer
Save Columns
Running analyzer against solution…
This can take up to a minute for large solutions.
Test Screen Control Counter
×
Runs this analyzer in isolation against the chosen solution. Nothing is saved — the result is shown here only.
Use an existing solution
No solutions uploaded yet
Upload a solution file
Cancel
Run test
Test results
×