bb-drummer/phpagstract

View on GitHub
docs/freiheit/assets/js/theme.main.js

Summary

Maintainability
D
2 days
Test Coverage

File theme.main.js has 516 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function($) {
    /**
     *
     * K15t Help Theme
     * Main Javascript
Severity: Major
Found in docs/freiheit/assets/js/theme.main.js - About 1 day to fix

    Function doSearch has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function doSearch(query) {
            var dropdown = $('.ht-search-input .ht-search-dropdown');
            var resultsList = dropdown.find('ul');
    
            resultsList.empty();
    Severity: Major
    Found in docs/freiheit/assets/js/theme.main.js - About 2 hrs to fix

      Function handleSearchResults has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              var handleSearchResults = function(searchResults, query) {
                  $(document).unbind('keydown');
      
                  $.each(searchResults, function (index, searchResult) {
                      resultsList.append('<li n="' + index + '" class="search-result"><a href="' + searchResult.link + '">' + searchResult.title + '</a></li>');
      Severity: Minor
      Found in docs/freiheit/assets/js/theme.main.js - About 1 hr to fix

        Function setDropdown has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function setDropdown(select) {
                var container = select.parent();
                var svg = '<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g class="ht-select-button-icon"><path d="M2,3 L8,3 L5,7 L2,3 Z"></path></g></svg>';
                var toggle = $('<a class="ht-select-button"><span>' + createOptionText(select.find('option:selected')) + '</span>' + svg + '</a>');
                container.append(toggle);
        Severity: Minor
        Found in docs/freiheit/assets/js/theme.main.js - About 1 hr to fix

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

              function toogleDropdown(container, open) {
                  if (open) {
                      $('body').bind('click', function (e) {
                          e.preventDefault();
                          if ($(e.target).is(container.find('*')))return;
          Severity: Minor
          Found in docs/freiheit/assets/js/theme.main.js - About 1 hr to fix

            Function initSearch has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function initSearch() {
                    var debounce = function(func, wait) {
                        var timeout;
                        var result;
                        return function() {
            Severity: Minor
            Found in docs/freiheit/assets/js/theme.main.js - About 1 hr to fix

              Function initKeyboard has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function initKeyboard() {
                      searchFieldActive = false;
              
                      $('body').bind('keyup', function (e) {
                          if (searchFieldActive && e.which != 27) {
              Severity: Minor
              Found in docs/freiheit/assets/js/theme.main.js - About 1 hr to fix

                There are no issues that match your filters.

                Category
                Status