Showing 34 of 63 total issues
Function Oe
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Oe(t, e, r, n) {
r.addEventListener(
'input',
ie(() => {
Re(t, e, r, n)
Function batch
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
batch(
uriCollector: (batchApi: IBatchApi) => string[],
isAtomic?: boolean,
isConcurrent?: boolean
): Promise<any[] | void> {
Function de
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function de() {
let t = document.getElementById('tsd-search')
if (!t) return
let e = document.getElementById('tsd-search-script')
t.classList.add('loading'),
Function getApiKey
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getApiKey(username: string, password: string, subdomain?: string): Promise<string> {
const loginParams = {
username,
password,
}
Function success
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: (response) => {
if (response.ok) {
return response.json().then((data) => {
if (data.error) {
throw {
Function request
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
request(
path: string,
params,
fields: TFields = [],
method: string = Api.Methods.GET
- 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
Avoid deeply nested control flow statements. Open
if (
(i[p].upsert(_, u.boost, function (Ee, be) {
return Ee + be
}),
!s[j])
Avoid deeply nested control flow statements. Open
if (
(u.presence == t.Query.presence.REQUIRED &&
((m = m.union(q)),
o[p] === void 0 && (o[p] = t.Set.complete)),
u.presence == t.Query.presence.PROHIBITED)
Avoid deeply nested control flow statements. Open
for (var l = 0; l < a.length; l++) s.push(a[l])
Consider simplifying this complex logical expression. Open
if ((e && typeof e == 'object') || typeof e == 'function')
for (let i of Te(e))
!Qe.call(t, i) &&
i !== r &&
re(t, i, {get: () => e[i], enumerable: !(n = we(e, i)) || n.enumerable})
Function constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor(config: IApiConfig) {
this.serverAcceptsJSON = true
this._uriGenerationMode = false
this._httpOptions = {
url: config.url,
- 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
Avoid too many return
statements within this function. Open
return e.emit(t.QueryLexer.PRESENCE), t.QueryLexer.lexText
Avoid too many return
statements within this function. Open
if (r.match(t.QueryLexer.termSeparator)) return t.QueryLexer.lexTerm
Function get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
get(objCode: string, objIDs: string | string[], fields?: TFields) {
if (typeof objIDs === 'string') {
objIDs = [objIDs]
}
let endPoint = objCode,
- 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"