LeDDGroup/scroll-utility

View on GitHub

Showing 3 of 4 total issues

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

export function getElementFromQuery(elementOrQuery: ElementOrQuery): Element | Window {
if (typeof elementOrQuery === "string") {
return document.querySelector(elementOrQuery) as Element
}
return elementOrQuery
Severity: Major
Found in src/element.ts and 1 other location - About 1 hr to fix
src/scroll.ts on lines 14..19

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

function getElementFromQuery(elementOrQuery: ElementOrQuery): Element | Window {
if (typeof elementOrQuery === "string") {
return document.querySelector(elementOrQuery) as Element
}
return elementOrQuery
Severity: Major
Found in src/scroll.ts and 1 other location - About 1 hr to fix
src/element.ts on lines 36..41

Function config has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function config(env: { NODE_ENV?: string } = {}): Configuration {
const production = env.NODE_ENV !== "development"
return {
mode: production ? "production" : "development",
entry: "./src/index.ts",
Severity: Minor
Found in webpack.config.ts - About 1 hr to fix
    Severity
    Category
    Status
    Source
    Language