You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove 12 confirmed dead code items
Store fields:
- HistoryStore.sshCmds (never accessed)
- HistoryStore.writeScriptTipShown (never accessed)
- SettingStore.storeVersion (never read/written)
Provider:
- PveNotifier.onlyOneNode (model getter used instead)
Enum values:
- SSHErrType.chdir (never instantiated)
- ContainerErrType.cmdNoPrefix (never referenced)
- SystemdUnitFunc.reload, .enable, .disable (never used)
Extensions/methods:
- SshDiscoveryConfigX.toArgs() (never called)
- ChainComparator.empty() (create() used instead)
- PortForwardStore.update/have/deleteByServer (never called)
Constants:
- Miscs.maxDebugLogLines (never referenced)
Other:
- SensorAdaptor static instances inlined in parse()
- Updated tests to match
* Remove 4 unused model fields
NvidiaSmiItem.uuid:
- Parsed from nvidia-smi XML but never read in UI or logic
AmdSmiItem.deviceId:
- Parsed from amd-smi JSON but never read in UI or logic
Conn.active, Conn.passive:
- Parsed from /proc/net/snmp but only maxConn and fail
are displayed in the connection stats view
Windows connCount moved from active to maxConn field
since that is the field actually shown in the UI.
* Deduplicate repeated code patterns
C1: Replace local _shellQuote in sftp.dart and sftp_sudo.dart
with canonical shellSingleQuote from shell_quote.dart
C2: Replace _formatSize in connection_stats.dart with
existing bytes2Str extension from fl_lib
C3: Extract _parseFirstInt helper in nvdia.dart to replace
6 instances of int.tryParse(s?.split(' ').firstOrNull ?? '0') ?? 0
C4: Extract _updateDiskUsage helper in server_status_update_req.dart
to deduplicate DiskUsage.parse guard pattern in Linux and BSD paths
* Performance: cache Proc.binary, optimize NetSpeed iteration
D1: Proc.binary getter re-parsed command string on every access
(called O(n log n) times during sort). Changed to late final
field so it is computed once per Proc instance.
D3: NetSpeed speedIn/sizeIn/speedOut/sizeOut used
devices.indexOf(device) inside loops (O(n) per iteration).
Replaced with index-based iteration for O(1) per iteration.
Also optimized deviceIdx to use direct index comparison
instead of iterating then calling indexOf.
D2 skipped: ref.listen in build() is correct Riverpod pattern
(Riverpod deduplicates listeners by identity).
* Fix prefix double-counting in NetSpeed, fix shell injection in SFTP edit
NetSpeed: realIfacePrefixs contains both 'wl' and 'wlan', so a device
like wlan0 matched both prefixes and was counted twice. Added break
after first prefix match in all 4 aggregation methods (speedIn,
sizeIn, speedOut, sizeOut).
SFTP edit: remotePath was wrapped with manual single quotes which
doesn't escape embedded single quotes. Replaced with
shellSingleQuote(remotePath) for proper escaping.
0 commit comments