MailOnline/videojs-vast-vpaid

View on GitHub

Showing 91 of 331 total issues

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

function muteVideoJSErrorLogs() {
  var patterns = muteVideoJSErrorLogs.IGNORED_PATTERNS;

  ['log', 'error', 'warn'].forEach(function (logFnName) {
    var log = console && console[logFnName];
Severity: Minor
Found in test/test-utils.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

Avoid too many return statements within this function.
Open

  return sValue.trim();
Severity: Major
Found in src/scripts/utils/xml.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return null;
    Severity: Major
    Found in src/scripts/ads/vast/VASTClient.js - About 30 mins to fix

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

      VPAIDIntegrator.prototype._setupEvents = function (adUnit, vastResponse, next) {
        var adUnitSrc = adUnit.options.src;
        var tracker = this._createVASTTracker(adUnitSrc, vastResponse);
        var player = this.player;
        var that = this;
      Severity: Minor
      Found in src/scripts/ads/vpaid/VPAIDIntegrator.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 urlParts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function urlParts(url) {
        var href = url;
      
        if (msie) {
          // Normalize before parse.  Refer Implementation Notes on why this is
      Severity: Minor
      Found in src/scripts/utils/urlUtils.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 buildVASTResponse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      VASTClient.prototype._buildVASTResponse = function buildVASTResponse(adsChain) {
        var response = new VASTResponse();
        addAdsToResponse(response, adsChain);
        validateResponse(response);
      
      
      Severity: Minor
      Found in src/scripts/ads/vast/VASTClient.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 isArrayLike has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function isArrayLike(obj) {
        if (obj === null || utilities.isWindow(obj) || utilities.isFunction(obj) || utilities.isUndefined(obj)) {
          return false;
        }
      
      
      Severity: Minor
      Found in src/scripts/utils/utilityFunctions.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 VideoClicks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function VideoClicks(videoClickJTree) {
        if (!(this instanceof VideoClicks)) {
          return new VideoClicks(videoClickJTree);
        }
      
      
      Severity: Minor
      Found in src/scripts/ads/vast/VideoClicks.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 InLine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function InLine(inlineJTree) {
        if (!(this instanceof InLine)) {
          return new InLine(inlineJTree);
        }
      
      
      Severity: Minor
      Found in src/scripts/ads/vast/InLine.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 iterator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      async.iterator = function (tasks) {
        var makeCallback = function (index) {
          var fn = function () {
            if (tasks.length) {
              tasks[index].apply(null, arguments);
      Severity: Minor
      Found in src/scripts/utils/async.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 waitForEvent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      VPAIDAdUnitWrapper.prototype.waitForEvent = function (evtName, cb, context) {
        var timeoutId;
        sanityCheck(evtName, cb);
        context = context || null;
      
      
      Severity: Minor
      Found in src/scripts/ads/vpaid/VPAIDAdUnitWrapper.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