javiercejudo/modelico

View on GitHub

Showing 25 of 30 total issues

Function jsonSchemaMetadata has 327 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const jsonSchemaMetadata = validate => {
  const getSchema = M.getSchema
  const metadata = M.metadata()
  const jscMetadata = {}

Severity: Major
Found in src/metadata/jsonSchemaMetadata.js - About 1 day to fix

    File jsonSchemaMetadata.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      identity,
      always,
      emptyObject,
      isFunction,
    Severity: Minor
    Found in src/metadata/jsonSchemaMetadata.js - About 4 hrs to fix

      Function jsonSchemaMetadata has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

      const jsonSchemaMetadata = validate => {
        const getSchema = M.getSchema
        const metadata = M.metadata()
        const jscMetadata = {}
      
      
      Severity: Minor
      Found in src/metadata/jsonSchemaMetadata.js - 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

      Function customLaunchers has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function customLaunchers() {
        return {
          SL_Chrome: {
            base: 'SauceLabs',
            browserName: 'chrome',
      Severity: Major
      Found in karma.conf.js - About 3 hrs to fix

        Function getSchema has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const getSchema = (metaOrType: Object, topLevel: boolean = true): Object => {
          const metadata = metaOrTypeMapper(M.metadata()._)(metaOrType)
        
          if (metadataSchemaCache.has(metadata)) {
            return metadataSchemaCache.get(metadata) || emptyObject
        Severity: Minor
        Found in src/getSchema.js - About 1 hr to fix

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

          Severity: Minor
          Found in src/U.js - 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 constructor has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            constructor(arg1, arg2 = emptyObject, thisArg) {
              let fields = arg2
              let Type = this.constructor
          
              if (isPlainObject(arg1)) {
          Severity: Minor
          Found in src/types/Base.js - About 1 hr to fix

            Function exports has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(config) {
              config.set({
                // base path that will be used to resolve all patterns (eg. files, exclude)
                basePath: '',
            
            
            Severity: Minor
            Found in karma.conf.js - About 1 hr to fix

              Function iterableReviverFactory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              const iterableReviverFactory = (IterableType: any, itemMetadata: any) => (
                k,
                v,
                path = []
              ) => {
              Severity: Minor
              Found in src/iterableHelpers.js - 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 getSchema has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              const getSchema = (metaOrType: Object, topLevel: boolean = true): Object => {
                const metadata = metaOrTypeMapper(M.metadata()._)(metaOrType)
              
                if (metadataSchemaCache.has(metadata)) {
                  return metadataSchemaCache.get(metadata) || emptyObject
              Severity: Minor
              Found in src/getSchema.js - 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 createUnionType has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const createUnionType = (metasOrTypes, classifier, union = defaultUnion) => {
                const metas = metasOrTypes.map(
                  x => (isPlainObject(x) && !(x instanceof M.Enum) ? x : M.metadata()._(x))
                )
              
              
              Severity: Minor
              Found in src/createUnionType.js - About 1 hr to fix

                Function toJSON has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                  toJSON() {
                    const v = this.inner()
                
                    return Object.is(v, -0)
                      ? '-0'
                Severity: Minor
                Found in src/types/Number.js - 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 iterableEquals has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                export const iterableEquals = (
                  thisArg: any,
                  other: any,
                  asUnordered: boolean = false
                ) => {
                Severity: Minor
                Found in src/iterableHelpers.js - 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 getSchemaImpl has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const getSchemaImpl = (metadata: Object): Object => {
                  if (metadata.schema) {
                    return enhanceSchemaWithDefault(metadata, metadata.schema())
                  }
                
                
                Severity: Minor
                Found in src/getSchema.js - About 1 hr to fix

                  Function equals has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                    equals(other, asUnordered = false) {
                      if (this === other) {
                        return true
                      }
                  
                  
                  Severity: Minor
                  Found in src/types/AbstractMap.js - About 55 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 createUnionType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const createUnionType = (metasOrTypes, classifier, union = defaultUnion) => {
                    const metas = metasOrTypes.map(
                      x => (isPlainObject(x) && !(x instanceof M.Enum) ? x : M.metadata()._(x))
                    )
                  
                  
                  Severity: Minor
                  Found in src/createUnionType.js - 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 reviverFactory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const reviverFactory = (keyMetadata, valueMetadata) => (k, v, path = []) => {
                    if (k !== '') {
                      return v
                    }
                  
                  
                  Severity: Minor
                  Found in src/types/EnumMap.js - 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 createModel has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const createModel = (
                    innerTypes = emptyObject,
                    {base = Base, stringTag = 'ModelicoModel', metadata: m = metadata} = {}
                  ) => {
                    const Model = class extends base {
                  Severity: Minor
                  Found in src/createModel.js - 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 reviverFactory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const reviverFactory = (keyMetadata, valueMetadata) => (k, v, path = []) => {
                    if (k !== '') {
                      return v
                    }
                  
                  
                  Severity: Minor
                  Found in src/types/Map.js - 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 reviverFactory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

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

                  Severity
                  Category
                  Status
                  Source
                  Language