prebid/Prebid.js

View on GitHub
modules/lotamePanoramaIdSystem.js

Summary

Maintainability
D
2 days
Test Coverage

Function getId has 127 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getId(config, consentData, cacheIdObj) {
    cookieDomain = lotamePanoramaIdSubmodule.findRootDomain();
    const configParams = (config && config.params) || {};
    const clientId = configParams.clientId;
    const hasCustomClientId = !isEmpty(clientId);
Severity: Major
Found in modules/lotamePanoramaIdSystem.js - About 5 hrs to fix

    Function getId has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

      getId(config, consentData, cacheIdObj) {
        cookieDomain = lotamePanoramaIdSubmodule.findRootDomain();
        const configParams = (config && config.params) || {};
        const clientId = configParams.clientId;
        const hasCustomClientId = !isEmpty(clientId);
    Severity: Minor
    Found in modules/lotamePanoramaIdSystem.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 resolveIdFunction has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        const resolveIdFunction = function (callback) {
          let queryParams = {};
          if (storedUserId) {
            queryParams.fp = storedUserId;
          }
    Severity: Major
    Found in modules/lotamePanoramaIdSystem.js - About 3 hrs to fix

      File lotamePanoramaIdSystem.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * This module adds LotamePanoramaId to the User ID module
       * The {@link module:modules/userId} module is required
       * @module modules/lotamePanoramaId
       * @requires module:modules/userId
      Severity: Minor
      Found in modules/lotamePanoramaIdSystem.js - About 2 hrs to fix

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

        function getFromStorage(key) {
          let value = null;
          if (storage.cookiesAreEnabled()) {
            value = storage.getCookie(key, undefined);
          }
        Severity: Minor
        Found in modules/lotamePanoramaIdSystem.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 saveLotameCache has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function saveLotameCache(
          key,
          value,
          expirationTimestamp = timestamp() + DAYS_TO_CACHE * DAY_MS
        ) {
        Severity: Minor
        Found in modules/lotamePanoramaIdSystem.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

        There are no issues that match your filters.

        Category
        Status