fossasia/loklak_webclient

View on GitHub
iframely/lib/whitelist.js

Summary

Maintainability
C
7 hrs
Test Coverage

Function findWhitelistRecordFor has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    whitelist.findWhitelistRecordFor = function(uri, options) {

        if (!whitelistObject) {
            return null;
        }
Severity: Major
Found in iframely/lib/whitelist.js - About 2 hrs to fix

    File whitelist.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function(whitelist) {
    
        var chokidar = require('chokidar'),
            fs = require('fs'),
            path = require('path'),
    Severity: Minor
    Found in iframely/lib/whitelist.js - About 2 hrs to fix

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

          function extractDomainPatterns(uri, disableWildcard) {
      
              var patterns = [];
      
              var domain = extractDomain(uri);
      Severity: Minor
      Found in iframely/lib/whitelist.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                                if (rel !== options.exclusiveRel) {
                                    // Remove all rels except exclusiveRel.
                                    delete record[rel];
                                }
        Severity: Major
        Found in iframely/lib/whitelist.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for(var type in protocol) {
                                      if (!(type in recordProtocol)) {
                                          recordProtocol[type] = protocol[type];
                                      }
                                  }
          Severity: Major
          Found in iframely/lib/whitelist.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (!recordProtocol) {
                                        recordProtocol = record[protocolId] = {};
                                    } else {
                                        recordProtocol = _.extend({}, recordProtocol);
                                    }
            Severity: Major
            Found in iframely/lib/whitelist.js - About 45 mins to fix

              There are no issues that match your filters.

              Category
              Status