rescribet/link-lib

View on GitHub

Showing 69 of 153 total issues

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

    public allValues(value: T): T[] {
        const node = this.nodes.get(value);
        if (!node) {
            return [value];
        }
Severity: Minor
Found in src/utilities/DisjointSet.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

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

    private registeredClasses(fields: Id[], topology: Id): Id[] {
        const classes = [rdfs.Resource.value];

        for (const field of fields) {
            if (typeof this.registrations[field] === "undefined") {
Severity: Minor
Found in src/ComponentStore/ComponentStore.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

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

export const linkMiddleware = <T, API extends LinkedDataAPI = DataProcessor>(catchActions = true):
  MiddlewareFn<T, API> => (lrs: LinkedRenderStore<T, API>): MiddlewareWithBoundLRS =>
        (next: MiddlewareActionHandler): MiddlewareActionHandler =>
            (action: SomeNode, args: any): Promise<any> => {

Severity: Minor
Found in src/linkMiddleware.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

Function processObject has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

export function processObject(subject: Node,
                              predicate: NamedNode,
                              datum: DataObject | SerializableDataTypes | null | undefined,
                              store: RDFAdapter,
                              ns?: NamespaceMap): NamedBlobTuple[] {
Severity: Minor
Found in src/processor/DataToGraph.ts - About 35 mins to fix

    Function checkRegistration has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                r: ComponentRegistration<T>,
                c: T,
                t: SomeNode,
                p: NamedNode,
                top: SomeNode,
    Severity: Minor
    Found in src/__tests__/LinkedRenderStore/components.spec.ts - About 35 mins to fix

      Function processResourceQueue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private async processResourceQueue(): Promise<void> {
              this.resourceQueueHandle = undefined;
              const queue = this.resourceQueue;
              this.resourceQueue = [];
      
      
      Severity: Minor
      Found in src/LinkedRenderStore.ts - About 35 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

      Function digDeeper has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public digDeeper(subject: Node | undefined, path: Array<NamedNode | NamedNode[]>): [Quadruple[], SomeNode[]] {
              if (path.length === 0 || typeof subject === "undefined") {
                  return [[], []];
              }
      
      
      Severity: Minor
      Found in src/LinkedRenderStore.ts - About 35 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

      Function findSubject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public findSubject(subject: Node | undefined, path: NamedNode[], match: Term | Term[]): Node[] {
              if (path.length === 0 || typeof subject === "undefined") {
                  return [];
              }
      
      
      Severity: Minor
      Found in src/LinkedRenderStore.ts - About 35 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

      Function registerRenderer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static registerRenderer<T>(
              component: T,
              types: Id[],
              fields: Id[],
              topologies: Id[],
      Severity: Minor
      Found in src/ComponentStore/ComponentStore.ts - About 35 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

      Function getEntity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public async getEntity(iri: NamedNode, opts?: APIFetchOpts): Promise<Quadruple[]> {
              const url = new URL(iri.value);
              url.hash = "";
              const requestIRI = rdfFactory.namedNode(url.toString());
              const existing = this.requestMap.get(requestIRI.id);
      Severity: Minor
      Found in src/processor/DataProcessor.ts - About 35 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

      Function deleteFieldMatching has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        public deleteFieldMatching(recordId: Id, field: FieldId, value: SomeTerm): void {
          const current = this.getField(recordId, field);
          if (current === undefined) {
            return;
          }
      Severity: Minor
      Found in src/store/StructuredStore.ts - About 35 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 ext;
      Severity: Major
      Found in src/utilities/responses.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return F_RDF_XML;
        Severity: Major
        Found in src/utilities/responses.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return null;
          Severity: Major
          Found in src/ComponentStore/ComponentStore.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return rdfFactory.namedNode(prop.slice(1, -1));
            Severity: Major
            Found in src/utilities/memoizedNamespace.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return constructor && constructor(matches[CI_MATCH_SUFFIX]);
              Severity: Major
              Found in src/utilities/memoizedNamespace.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return 0;
                Severity: Major
                Found in src/Schema.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return F_JSONLD;
                  Severity: Major
                  Found in src/utilities/responses.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return this.currentBroadcast = new ProcessBroadcast({
                                bulkSubscriptions: this.bulkSubscriptions.slice(),
                                changedSubjects: subjects,
                                subjectSubscriptions: Array.from(subjectRegs),
                                timeout: maxTimeout,
                    Severity: Major
                    Found in src/LinkedRenderStore.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return rdfFactory.namedNode(prop);
                      Severity: Major
                      Found in src/utilities/memoizedNamespace.ts - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language