Showing 69 of 153 total issues
Function processDelta
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public processDelta(delta: Array<Quadruple|void>): Quadruple[] {
for (const s of delta) {
const subj = s ? s[0] : undefined;
if (!s || !equals(s[QuadPosition.graph], ll.meta)) {
Function linkedDeltaProcessor
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function linkedDeltaProcessor(lrs: LinkedRenderStore<any>): ResponseTransformer {
return async function processLinkedDelta(response: ResponseAndFallbacks): Promise<Quadruple[]> {
let data: string;
if (response instanceof Response) {
data = response.bodyUsed ? "" : await response.text();
- 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 processObject
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function processObject(subject: Node,
predicate: NamedNode,
datum: DataObject | SerializableDataTypes | null | undefined,
store: RDFAdapter,
ns?: NamespaceMap): NamedBlobTuple[] {
- 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 getEntities
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public getEntities(resources: ResourceQueueItem[]): Promise<Quadruple[]> {
const reload: NamedNode[] = [];
const toBeFetched = new Set<NamedNode>();
Function mineForTypes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public mineForTypes(lookupTypes: string[]): string[] {
if (lookupTypes.length === 0) {
return [rdfs.Resource.value];
}
- 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 processObject
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function processObject(subject: Node,
predicate: NamedNode,
datum: DataObject | SerializableDataTypes | null | undefined,
store: RDFAdapter,
ns?: NamespaceMap): NamedBlobTuple[] {
Function handleStatus
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
async function handleStatus(res: ResponseAndFallbacks): Promise<ResponseAndFallbacks> {
if (res.status === NOT_FOUND) {
throw {
message: `404: '${getURL(res)}' could not be found`,
res,
- 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 toGraph
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function toGraph(
iriOrData: SomeNode | DataObject,
data?: DataObject,
store?: RDFAdapter,
ns?: NamespaceMap,
- 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 fieldReferences
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const fieldReferences = (values: FieldValue, referenced: Id): boolean => {
if (Array.isArray(values)) {
for (const value of values) {
if (value.termType !== TermType.Literal && value.value === referenced) {
return 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"
Further reading
Function quadsForRecord
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public quadsForRecord(recordId: Id): Quadruple[] {
const factory = this.rdfFactory;
const record = this.store.getRecord(recordId);
if (record === undefined) {
- 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 match
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public match(
aSubject: SomeNode | null,
aPredicate: NamedNode | null,
aObject: SomeTerm | null,
justOne: boolean = false,
Function processStatement
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
processStatement(
recordId: Id,
field: Id,
value: SomeTerm,
ctx: VocabularyProcessingContext,
Function expandProperty
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function expandProperty(prop: NamedNode | Term | string | undefined,
namespaces: NamespaceMap = {}): NamedNode | undefined {
if (!prop) {
return prop as undefined;
}
- 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 buildSlice
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const buildSlice = (creator: SliceCreator): DataSlice => {
if (creator === undefined) {
throw new Error("No creator passed");
}
Function queueDelta
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public queueDelta(delta: Quadruple[]): void {
this.deltas.push(delta);
const store = this.store.getInternalStore().store;
const llNS = ll.ns("").value;
const ldNS = ld.ns("").value;
- 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 contentTypeByMimeString
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function contentTypeByMimeString(contentType: string, ext: string): string | undefined {
if (contentType.includes(F_NTRIPLES) || contentType.includes(F_NTRIPLES_DEP)) {
return F_NTRIPLES;
} else if (contentType.includes(F_PLAIN) && ["ntriples", "nt"].indexOf(ext) >= 0) {
return F_NTRIPLES;
- 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 processStatement
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
processStatement(
recordId: Id,
field: Id,
value: SomeTerm,
ctx: VocabularyProcessingContext,
- 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 getEntities
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public getEntities(resources: ResourceQueueItem[]): Promise<Quadruple[]> {
const reload: NamedNode[] = [];
const toBeFetched = new Set<NamedNode>();
- 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 createProcessRDF
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const createProcessRDF = (rdfParse: RDFLibParse): (response: ResponseAndFallbacks) => Promise<Quadruple[]> => {
return async function processRDF(response: ResponseAndFallbacks): Promise<Quadruple[]> {
let data: string;
if (isRdfLibResponse(response)) {
data = response.responseText;
- 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 getContentType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getContentType(res: ResponseAndFallbacks): string {
const contentTypeRaw = getHeader(res, "Content-Type");
if (contentTypeRaw === undefined || contentTypeRaw === null) {
return "";
}
- 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"