Showing 62 of 157 total issues
Function exports
has 1198 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(variables) {
function getVariableValue(name) {
if (!variables || !(name in variables)) {
throw new Error('Undefined variable: ' + name);
}
File engine-default.js
has 1200 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = function(variables) {
function getVariableValue(name) {
if (!variables || !(name in variables)) {
throw new Error('Undefined variable: ' + name);
}
File SPARQLGenerator.ts
has 702 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ArrayTypeDescriptor,
DataSerializerUtils,
FilterQuery,
MapTypeDescriptor,
Function generateComponent
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
protected generateComponent(
key: string,
query: any,
dataType: Serializable<any>,
subject: Quad_Subject = DataFactory.variable('subject'),
- 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 generateComponent
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected generateComponent(
key: string,
query: any,
dataType: Serializable<any>,
subject: Quad_Subject = DataFactory.variable('subject'),
File InternalRDFDeserializer.ts
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ArrayTypeDescriptor,
DataSerializerUtils,
Deserializer,
DeserializerFn,
Function serializeObject
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
serializeObject<T, TD extends TypeDescriptor>(
sourceObject: T,
typeDescriptor: TD,
_: string,
serializer: Serializer,
- 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 serializeObject
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
serializeObject<T, TD extends TypeDescriptor>(
sourceObject: T,
typeDescriptor: TD,
_: string,
serializer: Serializer,
Function bundle
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const bundle = (env, module, entry = 'index', suffix = '') => {
const filename = `${PROJECT_NAME}${suffix}${module ? ".es" : ""}${env.prod ? ".min" : ""}`;
return {
name: PROJECT_NAME,
entry: `./dist/esm5/${entry}.js`,
- 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 deserializeObject
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
deserializeObject<T>(
sourceObject: Thing,
typeDescriptor: TypeDescriptor,
knownTypes: Map<string, Serializable<any>>,
_: string,
File InternalRDFSerializer.ts
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ArrayTypeDescriptor,
MapTypeDescriptor,
ObjectMemberMetadata,
ObjectMetadata,
Function generateArraySelector
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected generateArraySelector<T>(
selector: string,
subquery: QuerySelector<T>,
predicate: IriString,
dataType: Serializable<any>,
Function createConstruct
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected createConstruct(query: FilterQuery, dataType?: Serializable<T>): ConstructQuery {
const patterns: Pattern[] = [];
// Create a pattern for the datatype
const finalDataType = dataType || this.dataType;
if (finalDataType) {
Function delete
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
delete(
predicate: IriString,
object: Quad_Object | Thing | number | string | IriString | object,
languageOrDatatype?: string | IriString,
): RDFBuilder {
- 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 bundle
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
const bundle = (env, module, entry = 'index', suffix = '') => {
const filename = `${PROJECT_NAME}${suffix}${module ? ".es" : ""}${env.prod ? ".min" : ""}`;
return {
name: PROJECT_NAME,
entry: `./dist/esm5/${entry}.js`,
Function main
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function main() {
console.log(chalk.redBright('OpenHPS RDF Generator'));
if (args['c']) {
const configPath = path.normalize(args['c']);
Function rdfTypeResolver
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
rdfTypeResolver(
sourceObject: IndexedObject,
knownTypes: Map<string, Serializable<any>>,
knownRDFTypes: Map<IriString, string[]>,
): Serializable<any> {
- 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 deserializer
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
deserializer: (object: any) => {
if (!object) {
return 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 add
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
add(
predicate: IriString,
object: Quad_Object | Thing | number | string | IriString | object,
languageOrDatatype?: string | IriString,
): RDFBuilder {
- 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 rdfTypeResolver
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
rdfTypeResolver(
sourceObject: IndexedObject,
knownTypes: Map<string, Serializable<any>>,
knownRDFTypes: Map<IriString, string[]>,
): Serializable<any> {