OpenHPS/openhps-rdf

View on GitHub

Showing 207 of 207 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (
                !memberOptions ||
                (!(memberOptions.options.rdf as RDFLiteralOptions).predicate &&
                    !memberOptions.options.rdf.deserializer) ||
                memberOptions.options.rdf.identifier
Severity: Major
Found in src/rdf/InternalRDFDeserializer.ts and 1 other location - About 1 hr to fix
src/rdf/InternalRDFSerializer.ts on lines 225..232

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if (
                    !memberOptions ||
                    (!(memberOptions.options.rdf as RDFLiteralOptions).predicate &&
                        !memberOptions.options.rdf.serializer) ||
                    memberOptions.options.rdf.identifier
Severity: Major
Found in src/rdf/InternalRDFSerializer.ts and 1 other location - About 1 hr to fix
src/rdf/InternalRDFDeserializer.ts on lines 230..237

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function generateArraySelector has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected generateArraySelector<T>(
        selector: string,
        subquery: QuerySelector<T>,
        predicate: IriString,
        dataType: Serializable<any>,
Severity: Minor
Found in src/service/SPARQLGenerator.ts - About 1 hr to fix

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        deserializeArray(
            sourceObject: Quad_Object[],
            typeDescriptor: ArrayTypeDescriptor,
            knownTypes: Map<string, Serializable<any>>,
            memberName: string,
    Severity: Major
    Found in src/rdf/InternalRDFDeserializer.ts and 2 other locations - About 1 hr to fix
    src/rdf/InternalRDFDeserializer.ts on lines 389..443
    src/rdf/InternalRDFDeserializer.ts on lines 445..474

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 61.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                Object.keys(data.mirrors).forEach(source => {
                    console.log(`\t<${source}> -> <${data.mirrors[source]}>`)
                });
    Severity: Major
    Found in src/bin/cli.ts and 1 other location - About 1 hr to fix
    src/bin/cli.ts on lines 91..93

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 61.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        deserializeMap(
            sourceObject: Quad_Object[],
            typeDescriptor: MapTypeDescriptor,
            knownTypes: Map<string, Serializable<any>>,
            memberName: string,
    Severity: Major
    Found in src/rdf/InternalRDFDeserializer.ts and 2 other locations - About 1 hr to fix
    src/rdf/InternalRDFDeserializer.ts on lines 350..374
    src/rdf/InternalRDFDeserializer.ts on lines 445..474

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 61.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        deserializeSet(
            sourceObject: Quad_Object[],
            typeDescriptor: SetTypeDescriptor,
            knownTypes: Map<string, Serializable<any>>,
            memberName: string,
    Severity: Major
    Found in src/rdf/InternalRDFDeserializer.ts and 2 other locations - About 1 hr to fix
    src/rdf/InternalRDFDeserializer.ts on lines 350..374
    src/rdf/InternalRDFDeserializer.ts on lines 389..443

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 61.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            Object.keys(data.namespaces).forEach(ns => {
                console.log(`\t@prefix ${ns}: <${data.namespaces[ns]}> .`)
            });
    Severity: Major
    Found in src/bin/cli.ts and 1 other location - About 1 hr to fix
    src/bin/cli.ts on lines 109..111

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 61.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function fetchRemoteData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    async function fetchRemoteData(url: string, namespace: string): Promise<Quad[]> {
        const response = await axios.get(url, {
            headers: {
                'Accept': 'text/turtle, application/rdf+xml, text/html',
            },
    Severity: Minor
    Found in src/bin/generateNamespaceTs.ts - About 1 hr to fix

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      const urn_comunica_default_rdf_update_quads_actors_hypermedia = new (require('@comunica/actor-rdf-update-quads-hypermedia').ActorRdfUpdateQuadsHypermedia)({
        'cacheSize': 100,
        'httpInvalidator': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_rdf_update_quads_hypermedia__2_0_0_components_ActorRdfUpdateQuadsHypermedia_jsonld_IActorRdfUpdateQuadsHypermediaArgs_default_invalidator,
        'mediatorDereferenceRdf': urn_comunica_default_dereference_rdf_mediators_main,
        'mediatorMetadata': urn_comunica_default_rdf_metadata_mediators_main,
      Severity: Major
      Found in src/service/engine-minimal.js and 1 other location - About 1 hr to fix
      src/service/engine-default.js on lines 808..817

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      const urn_comunica_default_rdf_update_quads_actors_hypermedia = new (require('@comunica/actor-rdf-update-quads-hypermedia').ActorRdfUpdateQuadsHypermedia)({
        'cacheSize': 100,
        'httpInvalidator': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_rdf_update_quads_hypermedia__2_0_0_components_ActorRdfUpdateQuadsHypermedia_jsonld_IActorRdfUpdateQuadsHypermediaArgs_default_invalidator,
        'mediatorDereferenceRdf': urn_comunica_default_dereference_rdf_mediators_main,
        'mediatorMetadata': urn_comunica_default_rdf_metadata_mediators_main,
      Severity: Major
      Found in src/service/engine-default.js and 1 other location - About 1 hr to fix
      src/service/engine-minimal.js on lines 808..817

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                          delete: [
                              {
                                  type: 'bgp',
                                  triples: [
                                      {
      Severity: Major
      Found in src/service/SPARQLGenerator.ts and 1 other location - About 1 hr to fix
      src/service/SPARQLGenerator.ts on lines 122..133

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                          delete: [
                              {
                                  type: 'bgp',
                                  triples: [
                                      {
      Severity: Major
      Found in src/service/SPARQLGenerator.ts and 1 other location - About 1 hr to fix
      src/service/SPARQLGenerator.ts on lines 73..84

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function deserializePredicates has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function deserializePredicates(predicates: any) {
                  return Object.keys(predicates)
                      .map((predicate: any) => {
                          return {
                              [predicate]: predicates[predicate].map((item: any) => {
      Severity: Minor
      Found in src/mapping/DataObject.ts - About 1 hr to fix

        Function add has 30 lines of code (exceeds 25 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 1 hr to fix

          Function serializer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  serializer: (node: Node<any, any>, baseUri: IriString) => {
                      if (!(node instanceof ProcessingNode)) {
                          return undefined;
                      }
          
          
          Severity: Minor
          Found in src/mapping/Node.ts - About 1 hr to fix

            Function objectPatterns has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            ).map((predicate) => {
                                const patterns: Pattern[] = [];
                                const selectorPatterns = this.generateSelector(query, predicate, dataType, member, subject);
                                if (selectorPatterns.length > 0) {
                                    patterns.push(...selectorPatterns);
            Severity: Minor
            Found in src/service/SPARQLGenerator.ts - About 1 hr to fix

              Function deserializer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      deserializer: (thing: Thing) => {
                          let yaw = 0;
                          let roll = 0;
                          let pitch = 0;
                          let unit: AngleUnit;
              Severity: Minor
              Found in src/mapping/RelativeOrientation.ts - About 1 hr to fix

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                const urn_comunica_default_query_result_serialize_actors_stats = new (require('@comunica/actor-query-result-serialize-stats').ActorQueryResultSerializeStats)({
                  'httpObserver': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_query_result_serialize_stats__2_0_0_components_ActorQueryResultSerializeStats_jsonld_ActorQueryResultSerializeStats_default_observer,
                  'mediaTypePriorities': {"stats":0.5},
                  'mediaTypeFormats': {"stats":"https://comunica.linkeddatafragments.org/#results_stats"},
                  'name': 'urn:comunica:default:query-result-serialize/actors#stats',
                Severity: Major
                Found in src/service/engine-default.js and 1 other location - About 1 hr to fix
                src/service/engine-minimal.js on lines 918..924

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 57.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                const urn_comunica_default_query_result_serialize_actors_table = new (require('@comunica/actor-query-result-serialize-table').ActorQueryResultSerializeTable)({
                  'columnWidth': 50,
                  'mediaTypePriorities': {"table":0.6},
                  'mediaTypeFormats': {"table":"https://comunica.linkeddatafragments.org/#results_table"},
                  'name': 'urn:comunica:default:query-result-serialize/actors#table',
                Severity: Major
                Found in src/service/engine-minimal.js and 1 other location - About 1 hr to fix
                src/service/engine-default.js on lines 158..164

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 57.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language