mambax7/extcal

View on GitHub
assets/js/AC_RunActiveContent.js

Summary

Maintainability
D
2 days
Test Coverage

Function GetSwfVer has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

function GetSwfVer() {
    // NS/Opera version >= 3 check for Flash plugin in plugin array
    var flashVer = -1;

    if (navigator.plugins != null && navigator.plugins.length > 0) {
Severity: Minor
Found in assets/js/AC_RunActiveContent.js - 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 AC_GetArgs has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function AC_GetArgs(args, ext, srcParamName, classid, mimeType) {
    var ret = new Object();
    ret.embedAttrs = new Object();
    ret.params = new Object();
    ret.objAttrs = new Object();
Severity: Major
Found in assets/js/AC_RunActiveContent.js - About 3 hrs to fix

    Function DetectFlashVer has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) {
        versionStr = GetSwfVer();
        if (versionStr == -1) {
            return false;
        } else if (versionStr != 0) {
    Severity: Minor
    Found in assets/js/AC_RunActiveContent.js - 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 ControlVersion has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ControlVersion() {
        var version;
        var axo;
        var e;
    
    
    Severity: Minor
    Found in assets/js/AC_RunActiveContent.js - About 1 hr to fix

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

      function ControlVersion() {
          var version;
          var axo;
          var e;
      
      
      Severity: Minor
      Found in assets/js/AC_RunActiveContent.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 GetSwfVer has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function GetSwfVer() {
          // NS/Opera version >= 3 check for Flash plugin in plugin array
          var flashVer = -1;
      
          if (navigator.plugins != null && navigator.plugins.length > 0) {
      Severity: Minor
      Found in assets/js/AC_RunActiveContent.js - About 1 hr to fix

        Function DetectFlashVer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) {
            versionStr = GetSwfVer();
            if (versionStr == -1) {
                return false;
            } else if (versionStr != 0) {
        Severity: Minor
        Found in assets/js/AC_RunActiveContent.js - About 1 hr to fix

          Function AC_Generateobj has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function AC_Generateobj(objAttrs, params, embedAttrs) {
              var str = '';
              if (isIE && isWin && !isOpera) {
                  str += '<object ';
                  for (var i in objAttrs) {
          Severity: Minor
          Found in assets/js/AC_RunActiveContent.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 AC_GetArgs has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function AC_GetArgs(args, ext, srcParamName, classid, mimeType) {
          Severity: Minor
          Found in assets/js/AC_RunActiveContent.js - About 35 mins to fix

            Avoid too many return statements within this function.
            Open

                    return false;
            Severity: Major
            Found in assets/js/AC_RunActiveContent.js - About 30 mins to fix

              There are no issues that match your filters.

              Category
              Status