doshprompt/angular-localization

View on GitHub
src/localization.js

Summary

Maintainability
B
6 hrs
Test Coverage

File localization.js has 297 lines of code (exceeds 250 allowed). Consider refactoring.
Open

angular.module('ngLocalize')
    .service('locale', function ($injector, $http, $q, $log, $rootScope, $window, localeConf, localeEvents, localeSupported, localeFallbacks) {
        var TOKEN_REGEX = localeConf.validTokens || new RegExp('^[\\w\\.-]+\\.[\\w\\s\\.-]+\\w(:.*)?$'),
            $html = angular.element(document.body).parent(),
            currentLocale,
Severity: Minor
Found in src/localization.js - About 3 hrs to fix

    Function loadBundle has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function loadBundle(token) {
                var path = token ? token.split('.') : '',
                    root = bundles,
                    parent,
                    locale = currentLocale,
    Severity: Major
    Found in src/localization.js - About 2 hrs to fix

      Function getLocalizedString has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function getLocalizedString(txt, subs) {
                  var result = '',
                      bundle,
                      key,
                      A,
      Severity: Minor
      Found in src/localization.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status