Skip to content
Merged
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
11 changes: 1 addition & 10 deletions .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ duplication:
exclude_paths:
- "tests/**"

engines:
eslint:
config_file: eslintrc.config.js

# Exclude patterns - ignore test files and build artifacts from analysis
exclude_paths:
- "tests/**"
Expand All @@ -47,6 +43,7 @@ engines:
# ESLint configuration (if you want to customize)
eslint:
enabled: true
config_file: eslintrc.config.js
exclude_paths:
- "tests/**"

Expand All @@ -56,12 +53,6 @@ engines:
exclude_paths:
- "tests/**"

# Additional configuration
duplication:
enabled: true
exclude_paths:
- "tests/**"

# Complexity and code style checks
metrics:
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "networking-toolbox",
"private": true,
"version": "1.5.0",
"version": "1.6.0",
"type": "module",
"scripts": {
"dev": "vite dev",
Expand Down
10 changes: 0 additions & 10 deletions src/lib/stores/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,7 @@ function loadCustomFont(fontConfig: { name: string; url: string; fallback?: stri
if (fontLoaded) {
document.documentElement.classList.remove('fonts-loading');
document.documentElement.classList.add('fonts-loaded');
logger.debug(`Font loaded successfully: ${fontFamily}`, {
font: fontFamily,
component: 'ThemeStore',
});
} else {
// Font stylesheet loaded but font not available yet
logger.debug(`Font stylesheet loaded, waiting for font: ${fontFamily}`, {
font: fontFamily,
component: 'ThemeStore',
});

// Set a timeout fallback (3 seconds)
setTimeout(() => {
document.documentElement.classList.remove('fonts-loading');
Expand Down
20 changes: 12 additions & 8 deletions src/routes/cidr/mask-converter/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@

function getSubnetInfo(c: number) {
const subnet = COMMON_SUBNETS.find((s) => s.cidr === c);
return (
subnet || {
cidr: c,
mask: cidrToMask(c).octets.join('.'),
hosts: Math.pow(2, 32 - c) - 2,
}
);
if (subnet) return subnet;

// Calculate usable hosts per RFC 3021
const totalAddresses = Math.pow(2, 32 - c);
const hosts = c === 32 ? 1 : c === 31 ? 2 : totalAddresses - 2;

return {
cidr: c,
mask: cidrToMask(c).octets.join('.'),
hosts,
};
}

const subnetInfo = derived(cidr, ($c) => getSubnetInfo($c));
Expand Down Expand Up @@ -121,7 +125,7 @@
<div class="info-metric">
<span class="info-label">Usable Hosts</span>
<span class="metric-value success">
{get(subnetInfo).hosts.toLocaleString()}
{$subnetInfo.hosts.toLocaleString()}
</span>
</div>
</Tooltip>
Expand Down
Loading