peaceiris/actions-hugo

View on GitHub

Showing 7 of 7 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

describe('getArch', () => {
test('processor architecture', () => {
expect(getArch('x64')).toBe('64bit');
expect(getArch('arm')).toBe('ARM');
expect(getArch('arm64')).toBe('ARM64');
Severity: Major
Found in __tests__/get-arch.test.ts and 1 other location - About 4 hrs to fix
__tests__/get-os.test.ts on lines 3..15

Similar blocks of code found in 2 locations. Consider refactoring.
Open

describe('getOS', () => {
test('os type', () => {
expect(getOS('linux')).toBe('Linux');
expect(getOS('darwin')).toBe('macOS');
expect(getOS('win32')).toBe('Windows');
Severity: Major
Found in __tests__/get-os.test.ts and 1 other location - About 4 hrs to fix
__tests__/get-arch.test.ts on lines 3..15

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export default function getArch(arch: string): string {
switch (arch) {
case 'x64':
return '64bit';
case 'arm':
Severity: Major
Found in src/get-arch.ts and 1 other location - About 1 hr to fix
src/get-os.ts on lines 1..12

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export default function getOS(platform: string): string {
switch (platform) {
case 'linux':
return 'Linux';
case 'darwin':
Severity: Major
Found in src/get-os.ts and 1 other location - About 1 hr to fix
src/get-arch.ts on lines 1..12

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (process.platform === 'win32') {
const toolExtractedFolder: string = await tc.extractZip(toolAssets, tempDir);
toolBin = `${toolExtractedFolder}/${Tool.CmdName}.exe`;
} else {
Severity: Minor
Found in src/installer.ts and 1 other location - About 40 mins to fix
src/installer.ts on lines 68..71

Similar blocks of code found in 2 locations. Consider refactoring.
Open

} else {
const toolExtractedFolder: string = await tc.extractTar(toolAssets, tempDir);
toolBin = `${toolExtractedFolder}/${Tool.CmdName}`;
}
Severity: Minor
Found in src/installer.ts and 1 other location - About 40 mins to fix
src/installer.ts on lines 65..68

Function getURL has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function getURL(
os: string,
arch: string,
extended: string,
version: string
Severity: Minor
Found in src/get-url.ts - About 25 mins to fix
Severity
Category
Status
Source
Language