Showing 96 of 188 total issues
Function crawlMultiSiteWithEvent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const crawlMultiSiteWithEvent = (
props: CrawlParams
): Promise<CrawlMultiSite> => {
const { url, userId, subdomains, tld, agent, proxy } = props;
Function createIframe
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createIframe = async (
req: FastifyContext["request"],
res: FastifyContext["reply"]
) => {
const baseUrl = req.query["url"] || req.query["websiteUrl"];
Consider simplifying this complex logical expression. Open
if (
(typeof proxy !== "undefined" && !proxy) ||
(proxy &&
typeof proxy === "string" &&
(proxy.startsWith("http") ||
Function AnalyticsController
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const AnalyticsController = ({ user } = { user: null }) => ({
getCollection: analyticsCollection,
getWebsite: async (
{ pageUrl, userId, domain, bypass }: BaseParams & { bypass?: boolean },
chain?: boolean
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function websiteShape
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const websiteShape = (source: any) => {
let website;
if ("website" in source) {
website = source?.website;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function websiteSearchParams
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function websiteSearchParams({
userId,
url,
pageUrl,
domain,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getPages
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getPages = async (
{ domain, userId, url }: { domain?: string; userId?: number; url?: string },
chain?: boolean
) => {
if (!pagesCollection) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getDataUntil
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const getDataUntil = async (
baseProps: ScoreProps & { resolve: Resolver },
offset?: number,
prevIssuesInfo?: any
): Promise<void> => {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getIssue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getIssue = async (
{ url, pageUrl, userId, noRetries }: any,
chain?: boolean
) => {
const queryUrl = decodeURIComponent(String(url || pageUrl));
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function loadProto
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const loadProto = async (
target: string = "website.proto",
retry?: boolean
) => {
try {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function removeWebsite
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const removeWebsite = async ({
userId,
url = "",
domain = "",
deleteMany = false,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function rebindConcurrency
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const rebindConcurrency = async () => {
const newLimit = getCWLimit(crawlingSet.size || 1);
for (const item of crawlingSet.values()) {
const itemEvent = item && item?.event;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getPageSpeedPaging
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getPageSpeedPaging = async (p, chain?: boolean) => {
const { userId, domain, limit = 20, offset = 0, all = false } = p ?? {};
let params = {};
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function crawlProcessed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const crawlProcessed = (target) => {
setImmediate(async () => {
// process a new item tracking count
const key = getKey(target.domain, target.pages, target.user_id);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function allowedNext
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const allowedNext = (
token: string,
req: FastifyContext["request"],
res: FastifyContext["reply"],
mediaType?: "html" | "json"
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function websiteFormatter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const websiteFormatter = (source: any) => {
const { data, website, ...rest } = source;
const webPage = data ? data : website;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Consider simplifying this complex logical expression. Open
if (typeof userId !== undefined && userId !== null) {
const [user] = await UsersController().getUser({
id: userId,
});
Consider simplifying this complex logical expression. Open
if (passwordMatch || googleId || githubId) {
let keyid = user?.id;
let updateCollectionProps = {};
// create a new user
Function user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const user = async (_, { id, password }, ctx) => {
const { userId, audience } = getPayLoad(ctx, {
id,
password,
});
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function issuesResultsTemplate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const issuesResultsTemplate: IssuesResultsFound = (
data,
headingElement = "h1",
hideFooter = false,
freeAccount = true
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"