fossasia/loklak_webclient

View on GitHub
iframely/static/js/iframely.js

Summary

Maintainability
F
1 wk
Test Coverage

File iframely.js has 572 lines of code (exceeds 250 allowed). Consider refactoring.
Open

;(function ( $ ) {

    /*

     Iframely consumer client lib.
Severity: Major
Found in iframely/static/js/iframely.js - About 1 day to fix

    Function generate has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                generate: function(data, options) {
    
                    var iframelyData = options && options.iframelyData;
    
                    var givf = data.rel.indexOf('gifv') > -1;
    Severity: Major
    Found in iframely/static/js/iframely.js - About 2 hrs to fix

      Function findBestFittedLink has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.iframely.findBestFittedLink = function(targetWidth, targetHeight, links) {
      
              var sizedLinks = $.iframely.filterLinks(links, function(link) {
                  var media = link.media;
                  return media && media.width && media.height;
      Severity: Major
      Found in iframely/static/js/iframely.js - About 2 hrs to fix

        Function findBestSizedLink has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.iframely.findBestSizedLink = function(targetWidth, targetHeight, links) {
        
                var sizedLinks = $.iframely.filterLinks(links, function(link) {
                    var media = link.media;
                    return media && media.width && media.height;
        Severity: Minor
        Found in iframely/static/js/iframely.js - About 2 hrs to fix

          Function wrapContainer has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function wrapContainer($element, data) {
          
                  var media = data.media;
          
                  if (media && media.height && media.width && !media["aspect-ratio"]) {
          Severity: Minor
          Found in iframely/static/js/iframely.js - About 1 hr to fix

            Function filterLinksByRel has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $.iframely.filterLinksByRel = function(rel, links, options) {
            
                    var options = options || {};
            
                    if (typeof rel == "string") {
            Severity: Minor
            Found in iframely/static/js/iframely.js - About 1 hr to fix

              Function getPageData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.iframely.getPageData = function(uri, options, cb) {
              
                      if (typeof options === "function") {
                          cb = options;
                          options = {};
              Severity: Minor
              Found in iframely/static/js/iframely.js - About 1 hr to fix

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

                    var windowMessaging = function(){
                
                        return {
                            postMessage : function(message, target_url, target) {
                
                
                Severity: Minor
                Found in iframely/static/js/iframely.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if (items instanceof Array) {
                                          if (items.length > 0) {
                                              return items[0];
                                          }
                                      }
                  Severity: Major
                  Found in iframely/static/js/iframely.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if (cb(item)) {
                                                    result.push(item);
                                                }
                    Severity: Major
                    Found in iframely/static/js/iframely.js - About 45 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if (parentStyle && iframeStyle &&
                                      parentStyle.match('position: relative;') &&
                                      parentStyle.match('height: 0px;') &&
                                      iframeStyle.match('height: 100%;') &&
                                      iframeStyle.match('width: 100%;')) {
                      Severity: Major
                      Found in iframely/static/js/iframely.js - About 40 mins to fix

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

                            var windowMessaging = function(){
                        
                                return {
                                    postMessage : function(message, target_url, target) {
                        
                        
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 1 day to fix
                        iframely/static/js/iframely-for-iframe.js on lines 11..52

                        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 249.

                        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

                                            var thumbnails = $.iframely.filterLinks(iframelyData.links, function(link) {
                        
                                                if (hasPromo && link.rel.indexOf('promo') === -1) {
                                                    return;
                                                }
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 1 day to fix
                        iframely/lib/html-utils.js on lines 143..157

                        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 225.

                        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

                            $.iframely.registerIframe = function($iframe, id) {
                                if (!$iframe || $iframe.attr('iframely-registered')) {
                                    return;
                                }
                        
                        
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 6 hrs to fix
                        iframely/static/js/iframely-for-iframe.js on lines 90..108

                        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 163.

                        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

                            $.iframely.filterLinks = function(links, cb) {
                        
                                if (links) {
                        
                                    if (links instanceof Array) {
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 5 hrs to fix
                        iframely/lib/html-utils.js on lines 268..296

                        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 140.

                        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

                                "iframe": {
                                    test: function(data) {
                                        return data.type == "text/html" && data.href;
                                    },
                                    generate: function(data, options) {
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 5 hrs to fix
                        iframely/lib/html-utils.js on lines 212..231

                        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 138.

                        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

                                            thumbnails.sort(function(a, b) {
                                                var w1 = a.media && a.media.width;
                                                var w2 = b.media && b.media.width;
                                                if (w1 == w2) {
                                                    return 0;
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 4 hrs to fix
                        iframely/lib/html-utils.js on lines 160..176

                        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 128.

                        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

                                "image": {
                                    test: function(data) {
                                        return /^image(\/[\w\.-]+)?$/i.test(data.type)
                                            && data.href;
                                    },
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 4 hrs to fix
                        iframely/lib/html-utils.js on lines 81..97

                        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 122.

                        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

                            windowMessaging.receiveMessage(function(e, message) {
                                var $iframe;
                                if (message && message.windowId && ($iframe = $.iframely.iframes[message.windowId])) {
                                    if ($.iframely.setIframeHeight && message.method === "resize" && message.height) {
                                        $.iframely.setIframeHeight($iframe, message.height);
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 4 hrs to fix
                        iframely/static/js/iframely-for-iframe.js on lines 57..64

                        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 117.

                        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

                                "flash": {
                                    test: function(data) {
                                        return data.type === "application/x-shockwave-flash" && data.href;
                                    },
                                    generate: function(data, options) {
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 3 hrs to fix
                        iframely/lib/html-utils.js on lines 195..211

                        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 111.

                        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

                                            if (media) {
                        
                                                aspect = media["aspect-ratio"];
                        
                                                if (!aspect) {
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 3 hrs to fix
                        iframely/lib/html-utils.js on lines 119..136

                        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 109.

                        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 (result && options.httpsFirst) {
                                    result.sort(function(a, b) {
                                        var sa = isHttps(a.href);
                                        var sb = isHttps(b.href);
                                        if (sa == sb) {
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 3 hrs to fix
                        iframely/lib/html-utils.js on lines 334..348

                        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 102.

                        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 (media["aspect-ratio"]) {
                        
                                        $container.css('padding-bottom', Math.round(1000 * 100 / media["aspect-ratio"]) / 1000 + '%');
                        
                                        if (media["padding-bottom"]) {
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 2 hrs to fix
                        iframely/lib/html-utils.js on lines 39..56

                        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 75.

                        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

                            $.iframely.registerIframesIn = function($parent) {
                        
                                $parent.find('iframe').each(function() {
                                    var $iframe = $(this);
                                    $.iframely.registerIframe($iframe);
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 1 hr to fix
                        iframely/static/js/iframely-for-iframe.js on lines 81..88

                        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 71.

                        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

                                if (media && media.height && media.width && !media["aspect-ratio"]) {
                                    $element.attr('width', media.width);
                                    $element.attr('height', media.height);
                                    return $element;
                                }
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 1 hr to fix
                        iframely/lib/html-utils.js on lines 10..14

                        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 68.

                        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

                                    while (!found && idx < rel.length) {
                                        if (link.rel.indexOf(rel[idx]) > -1) {
                                            found = true;
                                        }
                                        idx++;
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 1 hr to fix
                        iframely/lib/html-utils.js on lines 324..330

                        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 62.

                        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

                                var sizedLinks = $.iframely.filterLinks(links, function(link) {
                                    var media = link.media;
                                    return media && media.width && media.height;
                                });
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 1 hr to fix
                        iframely/static/js/iframely.js on lines 473..476

                        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 56.

                        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

                                var sizedLinks = $.iframely.filterLinks(links, function(link) {
                                    var media = link.media;
                                    return media && media.width && media.height;
                                });
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 1 hr to fix
                        iframely/static/js/iframely.js on lines 558..561

                        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 56.

                        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

                                for(var key in renders) {
                                    var render = renders[key];
                                    if (render.test(link)) {
                                        return render.generate(link, options);
                                    }
                        Severity: Minor
                        Found in iframely/static/js/iframely.js and 1 other location - About 50 mins to fix
                        iframely/lib/html-utils.js on lines 260..265

                        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 51.

                        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

                                    test: function(data) {
                                        return (data.type == "video/mp4"
                                            || data.type == "video/webm"
                                            || data.type == "video/ogg");
                                    },
                        Severity: Minor
                        Found in iframely/static/js/iframely.js and 1 other location - About 35 mins to fix
                        iframely/lib/html-utils.js on lines 99..103

                        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 46.

                        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

                                        var responseJSON = function() {
                                            try {
                                                return JSON.parse(jqXHR.responseText);
                                            } catch(e) {};
                                        }();
                        Severity: Minor
                        Found in iframely/static/js/iframely.js and 1 other location - About 30 mins to fix
                        iframely/static/js/iframely.js on lines 172..176

                        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 45.

                        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

                                        var responseJSON = function(){
                                            try {
                                                return JSON.parse(jqXHR.responseText)
                                            } catch(e){};
                                        }();
                        Severity: Minor
                        Found in iframely/static/js/iframely.js and 1 other location - About 30 mins to fix
                        iframely/static/js/iframely.js on lines 195..199

                        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 45.

                        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

                                        $video.append('<source />')
                                            .children('source')
                                            .attr('src', data.href)
                                            .attr('type', data.type);
                        Severity: Minor
                        Found in iframely/static/js/iframely.js and 1 other location - About 30 mins to fix
                        iframely/lib/html-utils.js on lines 183..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 45.

                        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

                        There are no issues that match your filters.

                        Category
                        Status