OpenHPS/openhps-rdf

View on GitHub
src/rdf/InternalRDFDeserializer.ts

Summary

Maintainability
F
6 days
Test Coverage

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

        Function convertSingleValue has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            convertSingleValue(
                sourceObject: any,
                typeDescriptor: TypeDescriptor,
                knownTypes: Map<string, Serializable<any>>,
                memberName = 'object',
        Severity: Minor
        Found in src/rdf/InternalRDFDeserializer.ts - About 1 hr to fix

          Function deserializeMap has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              deserializeMap(
                  sourceObject: Quad_Object[],
                  typeDescriptor: MapTypeDescriptor,
                  knownTypes: Map<string, Serializable<any>>,
                  memberName: string,
          Severity: Minor
          Found in src/rdf/InternalRDFDeserializer.ts - About 1 hr to fix

            Function deserializeObject has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                deserializeObject<T>(
                    sourceObject: Thing,
                    typeDescriptor: TypeDescriptor,
                    knownTypes: Map<string, Serializable<any>>,
                    _: string,
            Severity: Minor
            Found in src/rdf/InternalRDFDeserializer.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

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

                convertSingleValue(
                    sourceObject: any,
                    typeDescriptor: TypeDescriptor,
                    knownTypes: Map<string, Serializable<any>>,
                    memberName = 'object',
            Severity: Minor
            Found in src/rdf/InternalRDFDeserializer.ts - About 45 mins 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

            Avoid too many return statements within this function.
            Open

                        return this.deserializeObject(
                            sourceObject,
                            typeDescriptor,
                            knownTypes,
                            memberName,
            Severity: Major
            Found in src/rdf/InternalRDFDeserializer.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return false;
              Severity: Major
              Found in src/rdf/InternalRDFDeserializer.ts - About 30 mins to fix

                Function deserializeLiteral has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    deserializeLiteral(sourceObject: Literal, typeDescriptor: TypeDescriptor): any {
                        if ((sourceObject as unknown as NamedNode).termType === 'NamedNode') {
                            return sourceObject.value;
                        }
                
                
                Severity: Minor
                Found in src/rdf/InternalRDFDeserializer.ts - About 25 mins 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

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

                    deserializationStrategy = new Map<Serializable<any>, DeserializerFn<any, TypeDescriptor, any>>([
                        [Number, this.deserializeLiteral.bind(this)],
                        [String, this.deserializeLiteral.bind(this)],
                        [Boolean, this.deserializeLiteral.bind(this)],
                        [Date, this.deserializeLiteral.bind(this)],
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 1 other location - About 5 hrs to fix
                src/rdf/InternalRDFSerializer.ts on lines 22..30

                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 143.

                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

                        const identifierMember = Array.from(metadata.dataMembers.values()).filter((member) => {
                            return (
                                member &&
                                member.options &&
                                member.options.rdf &&
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 1 other location - About 2 hrs to fix
                src/rdf/InternalRDFSerializer.ts on lines 141..148

                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 91.

                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

                        sourceObject
                            .map((object) => {
                                return deserializer.convertSingleValue(
                                    object,
                                    typeDescriptor.valueType,
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 1 other location - About 1 hr to fix
                src/rdf/InternalRDFDeserializer.ts on lines 458..472

                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 69.

                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

                        sourceObject
                            .map((object) => {
                                return deserializer.convertSingleValue(
                                    object,
                                    typeDescriptor.elementType,
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 1 other location - About 1 hr to fix
                src/rdf/InternalRDFDeserializer.ts on lines 402..441

                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 69.

                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 options =
                            metadata.options && metadata.options.rdf
                                ? metadata.options.rdf
                                : rootMetadata.options && rootMetadata.options.rdf
                                  ? rootMetadata.options.rdf
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 1 other location - About 1 hr to fix
                src/rdf/InternalRDFDeserializer.ts on lines 419..424

                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 67.

                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 options =
                                    metadata.options && metadata.options.rdf
                                        ? metadata.options.rdf
                                        : rootMetadata.options && rootMetadata.options.rdf
                                          ? rootMetadata.options.rdf
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 1 other location - About 1 hr to fix
                src/rdf/InternalRDFDeserializer.ts on lines 176..181

                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 67.

                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

                                    if (memberOptions.type().ctor === Array) {
                                        targetObject[memberOptions.key] = this.deserializeArray(
                                            sourceObject.predicates[predicateIri] as Quad_Object[],
                                            memberOptions.type() as ArrayTypeDescriptor,
                                            knownTypes,
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 2 other locations - About 1 hr to fix
                src/rdf/InternalRDFDeserializer.ts on lines 258..291
                src/rdf/InternalRDFDeserializer.ts on lines 268..291

                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 66.

                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

                                    } else if (memberOptions.type().ctor === Set) {
                                        targetObject[memberOptions.key] = this.deserializeSet(
                                            sourceObject.predicates[predicateIri] as Quad_Object[],
                                            memberOptions.type() as SetTypeDescriptor,
                                            knownTypes,
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 2 other locations - About 1 hr to fix
                src/rdf/InternalRDFDeserializer.ts on lines 248..291
                src/rdf/InternalRDFDeserializer.ts on lines 258..291

                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 66.

                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

                                    } else if (memberOptions.type().ctor === Map) {
                                        targetObject[memberOptions.key] = this.deserializeMap(
                                            sourceObject.predicates[predicateIri] as Quad_Object[],
                                            memberOptions.type() as MapTypeDescriptor,
                                            knownTypes,
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 2 other locations - About 1 hr to fix
                src/rdf/InternalRDFDeserializer.ts on lines 248..291
                src/rdf/InternalRDFDeserializer.ts on lines 268..291

                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 66.

                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.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 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 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

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

                            const memberOptions =
                                member.options && member.options.rdf
                                    ? member
                                    : rootMember && rootMember.options && rootMember.options.rdf
                                      ? rootMember
                Severity: Major
                Found in src/rdf/InternalRDFDeserializer.ts and 1 other location - About 1 hr to fix
                src/rdf/InternalRDFSerializer.ts on lines 218..223

                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 55.

                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

                There are no issues that match your filters.

                Category
                Status