Showing 59 of 321 total issues

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

                set(value) {
                    const attributeValue = getAttributeValues()
                        .filter((av) => av.attribute.name === attributeName)
                        .reduce((current, av) => av, undefined)

Severity: Minor
Found in src/model/helpers/attibutes.js - About 1 hr to fix

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

    export function createPeriodGeneratorsForLocale(locale = 'en') {
        return {
            generateDailyPeriodsForYear: (year) =>
                generateDailyPeriodsForYear(year, locale),
            generateWeeklyPeriodsForYear: (year) =>
    Severity: Minor
    Found in src/period/generators/index.js - About 1 hr to fix

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

          fromModel(model, passFilterAsDimension = false) {
              let request = this
      
              // extract dimensions from model
              const columns = model.columns || []
      Severity: Minor
      Found in src/analytics/AnalyticsRequest.js - About 1 hr to fix

        Function addDimension has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                addDimension(dimension, items) {
                    let dimensionIndex = 0
        
                    const existingDimension = this.dimensions.find((item, index) => {
                        if (item.dimension === dimension) {
        Severity: Minor
        Found in src/analytics/AnalyticsRequestDimensionsMixin.js - About 1 hr to fix

          Function addFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  addFilter(dimension, items) {
                      let filterIndex = 0
          
                      const existingFilter = this.filters.find((item, index) => {
                          if (item.dimension === dimension) {
          Severity: Minor
          Found in src/analytics/AnalyticsRequestFiltersMixin.js - About 1 hr to fix

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

                constructor(schema = {}, properties, validations, attributes, authorities) {
                    checkType(schema.singular, 'string')
                    checkType(schema.plural, 'string', 'Plural')
            
                    addLockedProperty(this, 'name', schema.singular)
            Severity: Minor
            Found in src/model/ModelDefinition.js - About 1 hr to fix

              Function getOptions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function getOptions(defaultHeaders, mergeOptions, requestData) {
                          const resultOptions = Object.assign(
                              {},
                              api.defaultFetchOptions,
                              mergeOptions
              Severity: Minor
              Found in src/api/Api.js - About 1 hr to fix

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

                function createModelPropertyDescriptor(propertiesObject, schemaProperty) {
                    const propertyName = schemaProperty.collection
                        ? schemaProperty.collectionName
                        : schemaProperty.name
                    const propertyDetails = {
                Severity: Minor
                Found in src/model/ModelDefinition.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 compareVersions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    static compareVersions(a, b) {
                        const from =
                            typeof a === 'string' || a instanceof String
                                ? System.parseVersionString(a)
                                : a
                Severity: Minor
                Found in src/system/System.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 processConfigForD2 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    static processConfigForD2(config, d2) {
                        const api = d2.Api.getApi()
                        d2.model.ModelDefinition.prototype.api = api
                        d2.models = d2.model.ModelDefinitions.getModelDefinitions()
                
                
                Severity: Minor
                Found in src/config.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 buildUrl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    buildUrl(options) {
                        // at least 1 dimension is required
                        let { dimensions } = this
                
                        if (options && options.sorted) {
                Severity: Minor
                Found in src/analytics/AnalyticsRequestBase.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 makePeriodFixture has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function makePeriodFixture(id, name, startDate, endDate, type) {
                Severity: Minor
                Found in src/period/__tests__/parser.spec.js - About 35 mins to fix

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

                      buildQuery(options) {
                          let { filters } = this
                  
                          if (options && options.sorted) {
                              filters = sortBy(filters, 'dimension')
                  Severity: Minor
                  Found in src/analytics/AnalyticsRequestBase.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

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

                      set(key, value) {
                          const that = this
                          let req
                  
                          if (key === 'systemId') {
                  Severity: Minor
                  Found in src/system/SystemConfiguration.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

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

                      constructor(fetchImpl) {
                          // Optionally provide fetch to the constructor so it can be mocked during testing
                          if (typeof fetchImpl === 'function') {
                              this.fetch = fetchImpl.bind(
                                  typeof window !== 'undefined' ? window : global
                  Severity: Minor
                  Found in src/api/Api.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

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

                      update(url, data, useMergeStrategy = false, options = {}) {
                          let payload = data
                  
                          // Ensure that headers are defined and are treated without case sensitivity
                          const requestOptions = {
                  Severity: Minor
                  Found in src/api/Api.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

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

                      post(url, data, options = {}) {
                          const requestUrl = getUrl(this.baseUrl, url)
                          let payload = data
                  
                          // Ensure that headers are defined and are treated without case sensitivity
                  Severity: Minor
                  Found in src/api/Api.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

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

                  export default (function x() {
                      const fixtures = {}
                  
                      function getFixture(fixtureName) {
                          if (fixtures && fixtures[fixtureName]) {
                  Severity: Minor
                  Found in src/__fixtures__/fixtures.js - 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

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

                  function createValidationSetting(validationObject, schemaProperty) {
                      const propertyName = schemaProperty.collection
                          ? schemaProperty.collectionName
                          : schemaProperty.name
                      const validationDetails = {
                  Severity: Minor
                  Found in src/model/ModelDefinition.js - 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

                  Severity
                  Category
                  Status
                  Source
                  Language