rescribet/link-lib

View on GitHub

Showing 75 of 143 total issues

File LinkedRenderStore.ts has 481 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import rdfFactory, {
    isQuad,
    NamedNode,
    Node,
    Quad,
Severity: Minor
Found in src/LinkedRenderStore.ts - About 7 hrs to fix

    Function Equatable has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

    export function Equatable<BC extends Constructable<IndexedStore & BasicStore>>(base: BC) {
        return class extends base {
            public aliases: Node[][] = [];
            public redirections: Node[] = [];
            public classOrder: Record<TermType, number> = {
    Severity: Minor
    Found in src/store/Equatable.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

    File DataProcessor.ts has 441 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import rdfFactory, {
      isBlankNode,
      NamedNode,
      Quad,
      QuadPosition,
    Severity: Minor
    Found in src/processor/DataProcessor.ts - About 6 hrs to fix

      File DataProcessor.spec.ts has 406 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import "../../__tests__/useHashFactory";
      
      import rdfFactory, { NamedNode, Quad } from "@ontologies/core";
      import * as rdfx from "@ontologies/rdf";
      import * as rdfs from "@ontologies/rdfs";
      Severity: Minor
      Found in src/processor/__tests__/DataProcessor.spec.ts - About 5 hrs to fix

        File RDFStore.spec.ts has 392 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import "jest";
        import "./useHashFactory";
        
        import rdfFactory, { createNS, Quadruple } from "@ontologies/core";
        import * as owl from "@ontologies/owl";
        Severity: Minor
        Found in src/__tests__/RDFStore.spec.ts - About 5 hrs to fix

          Function constructor has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

              constructor({ deltaProcessorOpts, innerStore }: RDFStoreOpts = {}) {
                  this.processDelta = this.processDelta.bind(this);
          
                  const g = innerStore || new RDFIndex();
                  this.store = addChangeBufferCallbacks(g, this);
          Severity: Minor
          Found in src/RDFStore.ts - About 4 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

          LinkedRenderStore has 35 functions (exceeds 20 allowed). Consider refactoring.
          Open

          export class LinkedRenderStore<T, API extends LinkedDataAPI = DataProcessor> implements Dispatcher {
              public static registerRenderer<T>(
                  component: T,
                  type: LazyNNArgument,
                  prop: LazyNNArgument = RENDER_CLASS_NAME,
          Severity: Minor
          Found in src/LinkedRenderStore.ts - About 4 hrs to fix

            Function Equatable has 105 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function Equatable<BC extends Constructable<IndexedStore & BasicStore>>(base: BC) {
                return class extends base {
                    public aliases: Node[][] = [];
                    public redirections: Node[] = [];
                    public classOrder: Record<TermType, number> = {
            Severity: Major
            Found in src/store/Equatable.ts - About 4 hrs to fix

              Function constructor has 98 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  constructor({ deltaProcessorOpts, innerStore }: RDFStoreOpts = {}) {
                      this.processDelta = this.processDelta.bind(this);
              
                      const g = innerStore || new RDFIndex();
                      this.store = addChangeBufferCallbacks(g, this);
              Severity: Major
              Found in src/RDFStore.ts - About 3 hrs to fix

                Function processStatement has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                    processStatement(item: Quad, ctx: VocabularyProcessingContext): Quad[] | null {
                        const result = [item];
                
                        const domainStatements = ctx.store.match(item.predicate, rdfs.domain, null, null);
                        if (domainStatements.length > 0) {
                Severity: Minor
                Found in src/schema/rdfs.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

                File RDFStore.ts has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import rdfFactory, {
                  DataFactory,
                  Feature,
                  NamedNode,
                  Quad,
                Severity: Minor
                Found in src/RDFStore.ts - About 3 hrs to fix

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

                      private broadcast(buffer = true, maxTimeout = 1000): Promise<void> {
                          if (maxTimeout !== 0 && this.currentBroadcast || this.broadcastHandle) {
                              return this.currentBroadcast || Promise.resolve();
                          }
                  
                  
                  Severity: Minor
                  Found in src/LinkedRenderStore.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 processStatement has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      processStatement(item: Quad, ctx: VocabularyProcessingContext): Quad[] | null {
                          const result = [item];
                  
                          const domainStatements = ctx.store.match(item.predicate, rdfs.domain, null, null);
                          if (domainStatements.length > 0) {
                  Severity: Major
                  Found in src/schema/rdfs.ts - About 2 hrs to fix

                    Function execActionByIRI has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public async execActionByIRI(subject: NamedNode, dataTuple: DataTuple): Promise<LinkedActionResponse> {
                    
                            const [graph, blobs = []] = dataTuple;
                    
                            if (this.store.quadsFor(subject).length === 0) {
                    Severity: Minor
                    Found in src/processor/DataProcessor.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 getRenderComponent has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public getRenderComponent(types: Indexable[],
                                                  predicates: Indexable[],
                                                  topology: Indexable,
                                                  defaultType: Indexable): T | undefined {
                            const oTypes = this.schema.expand(types);
                    Severity: Minor
                    Found in src/ComponentStore.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

                    DataProcessor has 24 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    export class DataProcessor implements LinkedDataAPI, DeltaProcessor {
                        public accept: { [k: string]: string };
                    
                        private _dispatch?: MiddlewareActionHandler;
                        private readonly bulkEndpoint: string;
                    Severity: Minor
                    Found in src/processor/DataProcessor.ts - About 2 hrs to fix

                      Function hextupleTransformer has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const hextupleTransformer: ResponseTransformer = async (res: ResponseAndFallbacks): Promise<Quad[]> => {
                        const bnMap: { [s: string]: BlankNode } = {};
                        // Skip the (expensive) proxy object when parsing
                        const quad = rdf.quad.bind(rdf);
                        const literal = rdf.literal.bind(rdf);
                      Severity: Major
                      Found in src/utilities/hextupleProcessor.ts - About 2 hrs to fix

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

                        export const hextupleTransformer: ResponseTransformer = async (res: ResponseAndFallbacks): Promise<Quad[]> => {
                          const bnMap: { [s: string]: BlankNode } = {};
                          // Skip the (expensive) proxy object when parsing
                          const quad = rdf.quad.bind(rdf);
                          const literal = rdf.literal.bind(rdf);
                        Severity: Minor
                        Found in src/utilities/hextupleProcessor.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

                        RDFStore has 23 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        export class RDFStore implements ChangeBuffer, DeltaProcessor {
                            public changeBuffer: Quad[] = new Array(100);
                            public changeBufferCount: number = 0;
                            /**
                             * Record of the last time a resource was flushed.
                        Severity: Minor
                        Found in src/RDFStore.ts - About 2 hrs to fix

                          Function broadcast has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private broadcast(buffer = true, maxTimeout = 1000): Promise<void> {
                                  if (maxTimeout !== 0 && this.currentBroadcast || this.broadcastHandle) {
                                      return this.currentBroadcast || Promise.resolve();
                                  }
                          
                          
                          Severity: Major
                          Found in src/LinkedRenderStore.ts - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language