OpenHPS/openhps-rdf

View on GitHub

Showing 52 of 207 total issues

File engine-minimal.js has 1061 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const df_419_2 = new (require('@comunica/logger-void').LoggerVoid)();
const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_init__2_0_0_components_ActorInit_jsonld_ActorInit_default_bus = new (require('@comunica/core').Bus)({
  'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-init/^2.0.0/components/ActorInit.jsonld#ActorInit_default_bus'
});
const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_context_preprocess__2_0_0_components_ActorContextPreprocess_jsonld_ActorContextPreprocess_default_bus = new (require('@comunica/core').Bus)({
Severity: Major
Found in src/service/engine-minimal.js - About 2 days to fix

    File engine-default.js has 1061 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const df_419_2 = new (require('@comunica/logger-void').LoggerVoid)();
    const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_init__2_0_0_components_ActorInit_jsonld_ActorInit_default_bus = new (require('@comunica/core').Bus)({
      'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-init/^2.0.0/components/ActorInit.jsonld#ActorInit_default_bus'
    });
    const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_context_preprocess__2_0_0_components_ActorContextPreprocess_jsonld_ActorContextPreprocess_default_bus = new (require('@comunica/core').Bus)({
    Severity: Major
    Found in src/service/engine-default.js - About 2 days to fix

      File SPARQLGenerator.ts has 553 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
          ArrayTypeDescriptor,
          DataSerializerUtils,
          FilterQuery,
          MapTypeDescriptor,
      Severity: Major
      Found in src/service/SPARQLGenerator.ts - About 1 day to fix

        Function generateComponent has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

            protected generateComponent(
                key: string,
                query: any,
                dataType: Serializable<any>,
                subject: Quad_Subject = DataFactory.variable('subject'),
        Severity: Minor
        Found in src/service/SPARQLGenerator.ts - About 7 hrs to fix

        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 173 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected generateComponent(
                key: string,
                query: any,
                dataType: Serializable<any>,
                subject: Quad_Subject = DataFactory.variable('subject'),
        Severity: Major
        Found in src/service/SPARQLGenerator.ts - About 6 hrs to fix

          File InternalRDFDeserializer.ts has 438 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
              ArrayTypeDescriptor,
              DataSerializerUtils,
              Deserializer,
              DeserializerFn,
          Severity: Minor
          Found in src/rdf/InternalRDFDeserializer.ts - About 6 hrs to fix

            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`,
            Severity: Minor
            Found in webpack.config.js - About 5 hrs to fix

            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 132 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                deserializeObject<T>(
                    sourceObject: Thing,
                    typeDescriptor: TypeDescriptor,
                    knownTypes: Map<string, Serializable<any>>,
                    _: string,
            Severity: Major
            Found in src/rdf/InternalRDFDeserializer.ts - About 5 hrs to fix

              Function serializeObject has 106 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  serializeObject<T, TD extends TypeDescriptor>(
                      sourceObject: T,
                      typeDescriptor: TD,
                      _: string,
                      serializer: Serializer,
              Severity: Major
              Found in src/rdf/InternalRDFSerializer.ts - About 4 hrs to fix

                File InternalRDFSerializer.ts has 304 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import {
                    ArrayTypeDescriptor,
                    MapTypeDescriptor,
                    ObjectMemberMetadata,
                    ObjectMetadata,
                Severity: Minor
                Found in src/rdf/InternalRDFSerializer.ts - About 3 hrs to fix

                  Function serializeObject has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                      serializeObject<T, TD extends TypeDescriptor>(
                          sourceObject: T,
                          typeDescriptor: TD,
                          _: string,
                          serializer: Serializer,
                  Severity: Minor
                  Found in src/rdf/InternalRDFSerializer.ts - About 3 hrs to fix

                  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`,
                  Severity: Major
                  Found in webpack.config.js - About 3 hrs to fix

                    Function createConstruct has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected createConstruct(query: FilterQuery): ConstructQuery {
                            const patterns = this.createQuery(query);
                            // Variables
                            const subjectVar = DataFactory.variable('subject');
                            const propVar = DataFactory.variable('prop');
                    Severity: Major
                    Found in src/service/SPARQLGenerator.ts - About 2 hrs to fix

                      Function deserializer has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          deserializer: (object: any) => {
                              if (!object) {
                                  return undefined;
                              }
                      
                      
                      Severity: Minor
                      Found in src/mapping/DataObject.ts - About 2 hrs to fix

                      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 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> {
                      Severity: Minor
                      Found in src/rdf/InternalRDFDeserializer.ts - About 2 hrs to fix

                      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 main has 60 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']);
                      Severity: Major
                      Found in src/bin/cli.ts - About 2 hrs to fix

                        Function rdfTypeResolver has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            rdfTypeResolver(
                                sourceObject: IndexedObject,
                                knownTypes: Map<string, Serializable<any>>,
                                knownRDFTypes: Map<IriString, string[]>,
                            ): Serializable<any> {
                        Severity: Major
                        Found in src/rdf/InternalRDFDeserializer.ts - About 2 hrs to fix

                          Function add has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                              add(
                                  predicate: IriString,
                                  object: Quad_Object | Thing | number | string | IriString | object,
                                  languageOrDatatype?: string | IriString,
                              ): RDFBuilder {
                          Severity: Minor
                          Found in src/rdf/RDFBuilder.ts - About 2 hrs to fix

                          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 convertSingleValue has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              convertSingleValue(
                                  sourceObject: any,
                                  typeDescriptor: TypeDescriptor,
                                  memberName: string,
                                  memberOptions?: ObjectMemberMetadata,
                          Severity: Major
                          Found in src/rdf/InternalRDFSerializer.ts - About 2 hrs to fix

                            Function convertSingleValue has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                                convertSingleValue(
                                    sourceObject: any,
                                    typeDescriptor: TypeDescriptor,
                                    memberName: string,
                                    memberOptions?: ObjectMemberMetadata,
                            Severity: Minor
                            Found in src/rdf/InternalRDFSerializer.ts - About 1 hr to fix

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language