mambax7/smartfaq

View on GitHub

Showing 649 of 649 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if (hasAnchor) {
        placeX = rmrkPosition[0];
        placeY = rmrkPosition[1];
    } else {
        // Horizontal scroll offset
Severity: Major
Found in assets/js/overlib/overlib_followscroll.js and 1 other location - About 5 days to fix
assets/js/overlib/overlib_anchor.js on lines 128..232

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 922.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if (o3_anchor) {
        placeX = rmrkPosition[0];
        placeY = rmrkPosition[1];
    } else {
        // Horizontal scroll offset
Severity: Major
Found in assets/js/overlib/overlib_anchor.js and 1 other location - About 5 days to fix
assets/js/overlib/overlib_followscroll.js on lines 82..186

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 922.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if (o3_anchor) {
        placeX = rmrkPosition[0];
        placeY = rmrkPosition[1];
    } else {
        winoffset = (olIe4) ? eval('o3_frame.' + docRoot + '.scrollLeft') : o3_frame.pageXOffset;
Severity: Major
Found in assets/js/overlib/mini/overlib_anchor_mini.js and 1 other location - About 5 days to fix
assets/js/overlib/mini/overlib_followscroll_mini.js on lines 43..118

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 876.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if (hasAnchor) {
        placeX = rmrkPosition[0];
        placeY = rmrkPosition[1];
    } else {
        winoffset = (olIe4) ? eval('o3_frame.' + docRoot + '.scrollLeft') : o3_frame.pageXOffset;
Severity: Major
Found in assets/js/overlib/mini/overlib_followscroll_mini.js and 1 other location - About 5 days to fix
assets/js/overlib/mini/overlib_anchor_mini.js on lines 77..152

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 876.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function parseTokens has a Cognitive Complexity of 247 (exceeds 5 allowed). Consider refactoring.
Open

function parseTokens(pf, ar) {
    // What the next argument is expected to be.
    var v, mode = -1, par = (pf != 'ol_');
    var fnMark = (par && !ar.length ? 1 : 0);

Severity: Minor
Found in assets/js/overlib/overlib.js - About 5 days 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 parseTokens has a Cognitive Complexity of 247 (exceeds 5 allowed). Consider refactoring.
Open

function parseTokens(pf, ar) {
    var v, mode = -1, par = (pf != 'ol_');
    var fnMark = (par && !ar.length ? 1 : 0);
    for (i = 0; i < ar.length; i++) {
        if (mode < 0) {
Severity: Minor
Found in assets/js/overlib/mini/overlib_mini.js - About 5 days 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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

function parseCSSStyleExtras(pf, i, ar) {
    var k = i;

    if (k < ar.length) {
        if (ar[k] == CSSSTYLE) {
Severity: Major
Found in assets/js/overlib/overlib_cssstyle.js and 1 other location - About 4 days to fix
assets/js/overlib/mini/overlib_cssstyle_mini.js on lines 59..128

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 713.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

function parseCSSStyleExtras(pf, i, ar) {
    var k = i;
    if (k < ar.length) {
        if (ar[k] == CSSSTYLE) {
            eval(pf + 'css=' + ar[k]);
Severity: Major
Found in assets/js/overlib/mini/overlib_cssstyle_mini.js and 1 other location - About 4 days to fix
assets/js/overlib/overlib_cssstyle.js on lines 93..164

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 713.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

function reOrder(hookPt, fnRef, order) {
    if (!order || typeof order == 'undefined' || typeof order == 'number') return;
    var newPt = new Array(), match;
    if (typeof order == 'function') {
        if (typeof fnRef == 'object') {
Severity: Major
Found in assets/js/overlib/mini/overlib_mini.js and 1 other location - About 4 days to fix
assets/js/overlib/overlib.js on lines 1446..1512

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 688.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

function reOrder(hookPt, fnRef, order) {
    if (!order || typeof order == 'undefined' || typeof order == 'number') return;

    var newPt = new Array(), match;

Severity: Major
Found in assets/js/overlib/overlib.js and 1 other location - About 4 days to fix
assets/js/overlib/mini/overlib_mini.js on lines 1109..1165

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 688.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File overlib.js has 1174 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//\/////
//\  overLIB 4.05 - You may not remove or change this notice.
//\  Copyright Erik Bosrup 1998-2004. All rights reserved.
//\
//\  Contributors are listed on the homepage.
Severity: Major
Found in assets/js/overlib/overlib.js - About 3 days to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    function ol_content_caption(text, title, close) {
        var nameId;
        closing = "";
        closeevent = "onmouseover";
        if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle + "'" : "") + " onclick";
    Severity: Major
    Found in assets/js/overlib/mini/overlib_mini.js and 1 other location - About 3 days to fix
    assets/js/overlib/overlib.js on lines 480..497

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 518.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    function ol_content_caption(text, title, close) {
        var nameId;
        closing = "";
        closeevent = "onmouseover";
        if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle + "'" : "") + " onclick";
    Severity: Major
    Found in assets/js/overlib/overlib.js and 1 other location - About 3 days to fix
    assets/js/overlib/mini/overlib_mini.js on lines 358..373

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 518.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    File overlib_mini.js has 1168 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    //\/////
    //\  overLIB 4.05 - You may not remove or change this notice.
    //\  Copyright Erik Bosrup 1998-2004. All rights reserved.
    //\
    //\  Contributors are listed on the homepage.
    Severity: Major
    Found in assets/js/overlib/mini/overlib_mini.js - About 3 days to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      function ol_content_caption_cssstyle(text, title, close) {
          var nameId;
          closing = "";
          closeevent = "onMouseOver";
          if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle + "'" : "") + " onClick";
      Severity: Major
      Found in assets/js/overlib/mini/overlib_cssstyle_mini.js and 1 other location - About 2 days to fix
      assets/js/overlib/overlib_cssstyle.js on lines 179..200

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 473.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      function ol_content_caption_cssstyle(text, title, close) {
          var nameId;
          closing = "";
          closeevent = "onMouseOver";
      
      
      Severity: Major
      Found in assets/js/overlib/overlib_cssstyle.js and 1 other location - About 2 days to fix
      assets/js/overlib/mini/overlib_cssstyle_mini.js on lines 134..150

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 473.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function scroll_placeLayer has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
      Open

      function scroll_placeLayer() {
          var placeX, placeY, widthFix = 0;
          var hasAnchor = (typeof o3_anchor != 'undefined' && o3_anchor);
          if (eval('o3_frame.' + docRoot) && eval("typeof o3_frame." + docRoot + ".clientWidth=='number'") && eval('o3_frame.' + docRoot + '.clientWidth')) {
              iwidth = eval('o3_frame.' + docRoot + '.clientWidth');
      Severity: Minor
      Found in assets/js/overlib/mini/overlib_followscroll_mini.js - About 2 days 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 scroll_placeLayer has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
      Open

      function scroll_placeLayer() {
          var placeX, placeY, widthFix = 0;
          var hasAnchor = (typeof o3_anchor != 'undefined' && o3_anchor);
      
          // HORIZONTAL PLACEMENT
      Severity: Minor
      Found in assets/js/overlib/overlib_followscroll.js - About 2 days 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 anchorPlaceLayer has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
      Open

      function anchorPlaceLayer() {
          var placeX, placeY, widthFix = 0;
          if (eval('o3_frame.' + docRoot) && eval("typeof o3_frame." + docRoot + ".clientWidth=='number'") && eval('o3_frame.' + docRoot + '.clientWidth')) {
              iwidth = eval('o3_frame.' + docRoot + '.clientWidth');
          } else if (typeof(o3_frame.innerWidth) == 'number') {
      Severity: Minor
      Found in assets/js/overlib/mini/overlib_anchor_mini.js - About 2 days 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 anchorPlaceLayer has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
      Open

      function anchorPlaceLayer() {
          var placeX, placeY, widthFix = 0;
      
          // HORIZONTAL PLACEMENT
          if (eval('o3_frame.' + docRoot) && eval("typeof o3_frame." + docRoot + ".clientWidth ==  'number'") && eval('o3_frame.' + docRoot + '.clientWidth')) {
      Severity: Minor
      Found in assets/js/overlib/overlib_anchor.js - About 2 days 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