diff --git a/.codacy.yml b/.codacy.yml index ed54cead..4fa1132d 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -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/**" @@ -47,6 +43,7 @@ engines: # ESLint configuration (if you want to customize) eslint: enabled: true + config_file: eslintrc.config.js exclude_paths: - "tests/**" @@ -56,12 +53,6 @@ engines: exclude_paths: - "tests/**" -# Additional configuration -duplication: - enabled: true - exclude_paths: - - "tests/**" - # Complexity and code style checks metrics: enabled: true diff --git a/package.json b/package.json index 4e629a75..25e7cb20 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "networking-toolbox", "private": true, - "version": "1.5.0", + "version": "1.6.0", "type": "module", "scripts": { "dev": "vite dev", diff --git a/src/lib/stores/theme.ts b/src/lib/stores/theme.ts index 5affb88d..92e044f7 100644 --- a/src/lib/stores/theme.ts +++ b/src/lib/stores/theme.ts @@ -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'); diff --git a/src/routes/cidr/mask-converter/+layout.svelte b/src/routes/cidr/mask-converter/+layout.svelte index 836eb41f..16304f72 100644 --- a/src/routes/cidr/mask-converter/+layout.svelte +++ b/src/routes/cidr/mask-converter/+layout.svelte @@ -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)); @@ -121,7 +125,7 @@
Usable Hosts - {get(subnetInfo).hosts.toLocaleString()} + {$subnetInfo.hosts.toLocaleString()}