AlexRogalskiy/java-patterns

View on GitHub

Showing 70 of 70 total issues

Function render has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render(isNormalMode) {
        let tp = lithtml.html(`
        <nav>
            <ul class="list">
                <li class="title">
Severity: Major
Found in packages/schema-diff/docs/js/menu-wc.js - About 3 hrs to fix

    File menu.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    document.addEventListener('DOMContentLoaded', function () {
        var menuCollapsed = false,
            mobileMenu = document.getElementById('mobile-menu');
    
        var localContextInUrl = '';
    Severity: Minor
    Found in packages/schema-diff/docs/js/menu.js - About 3 hrs to fix

      File menu.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      document.addEventListener('DOMContentLoaded', function () {
          var menuCollapsed = false,
              mobileMenu = document.getElementById('mobile-menu');
      
          var localContextInUrl = '';
      Severity: Minor
      Found in packages/github-client/docs/js/menu.js - About 3 hrs to fix

        File menu.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        document.addEventListener('DOMContentLoaded', function () {
            var menuCollapsed = false,
                mobileMenu = document.getElementById('mobile-menu');
        
            var localContextInUrl = '';
        Severity: Minor
        Found in packages/changelog/docs/js/menu.js - About 3 hrs to fix

          File menu.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          document.addEventListener('DOMContentLoaded', function () {
              var menuCollapsed = false,
                  mobileMenu = document.getElementById('mobile-menu');
          
              var localContextInUrl = '';
          Severity: Minor
          Found in packages/contributors-view/docs/js/menu.js - About 3 hrs to fix

            Function displayResults has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function displayResults(res) {
                    var noResults = res.count == 0;
                    var groups = {};
                    $searchResults.toggleClass('no-results', noResults);
            
            
            Severity: Major
            Found in packages/contributors-view/docs/js/search/search.js - About 2 hrs to fix

              Function displayResults has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function displayResults(res) {
                      var noResults = res.count == 0;
                      var groups = {};
                      $searchResults.toggleClass('no-results', noResults);
              
              
              Severity: Major
              Found in packages/github-client/docs/js/search/search.js - About 2 hrs to fix

                Function displayResults has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function displayResults(res) {
                        var noResults = res.count == 0;
                        var groups = {};
                        $searchResults.toggleClass('no-results', noResults);
                
                
                Severity: Major
                Found in packages/schema-diff/docs/js/search/search.js - About 2 hrs to fix

                  Function displayResults has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function displayResults(res) {
                          var noResults = res.count == 0;
                          var groups = {};
                          $searchResults.toggleClass('no-results', noResults);
                  
                  
                  Severity: Major
                  Found in packages/changelog/docs/js/search/search.js - About 2 hrs to fix

                    Function render has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        render(isNormalMode) {
                            let tp = lithtml.html(`
                            <nav>
                                <ul class="list">
                                    <li class="title">
                    Severity: Major
                    Found in packages/contributors-view/docs/js/menu-wc.js - About 2 hrs to fix

                      File index.ts has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*
                       * Copyright (C) 2022 SensibleMetrics, Inc. (http://sensiblemetrics.io/)
                       *
                       * Licensed under the Apache License, Version 2.0 (the "License");
                       * you may not use this file except in compliance with the License.
                      Severity: Minor
                      Found in packages/schema-diff/src/index.ts - About 2 hrs to fix

                        Function doWork has a Cognitive Complexity of 19 (exceeds 7 allowed). Consider refactoring.
                        Open

                        const doWork = async (repo) => {
                          const readme = await getFile(gh, repo, "README.md")
                          if (!readme) {
                            log(repo, "Could not find a README")
                            return
                        Severity: Minor
                        Found in packages/github-client/src/index.ts - About 2 hrs 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 editDistance has a Cognitive Complexity of 18 (exceeds 7 allowed). Consider refactoring.
                        Open

                        const editDistance = (s1: string, s2: string) => {
                          s1 = s1.toLowerCase()
                          s2 = s2.toLowerCase()
                        
                          const costs = new Array<number>()
                        Severity: Minor
                        Found in packages/contributors-view/src/helpers/similarity.ts - About 2 hrs 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 render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            render(isNormalMode) {
                                let tp = lithtml.html(`
                                <nav>
                                    <ul class="list">
                                        <li class="title">
                        Severity: Major
                        Found in packages/changelog/docs/js/menu-wc.js - About 2 hrs to fix

                          Function render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              render(isNormalMode) {
                                  let tp = lithtml.html(`
                                  <nav>
                                      <ul class="list">
                                          <li class="title">
                          Severity: Major
                          Found in packages/github-client/docs/js/menu-wc.js - About 2 hrs to fix

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

                            const fetchContributors = (
                              page: string
                            ): Promise<{ contributorsOfPage: Contributor[]; nextPage: string }> => {
                              return new Promise((resolve, reject) => {
                                const requestOptions: https.RequestOptions = {
                            Severity: Minor
                            Found in packages/contributors-view/src/index.ts - About 1 hr to fix

                              Function bindSearch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function bindSearch() {
                                      // Bind DOM
                                      $searchInputs        = $('#book-search-input input');
                              
                                      $searchResults = $('.search-results');
                              Severity: Minor
                              Found in packages/github-client/docs/js/search/search.js - About 1 hr to fix

                                Function bindSearch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function bindSearch() {
                                        // Bind DOM
                                        $searchInputs        = $('#book-search-input input');
                                
                                        $searchResults = $('.search-results');
                                Severity: Minor
                                Found in packages/schema-diff/docs/js/search/search.js - About 1 hr to fix

                                  Function bindSearch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function bindSearch() {
                                          // Bind DOM
                                          $searchInputs        = $('#book-search-input input');
                                  
                                          $searchResults = $('.search-results');
                                  Severity: Minor
                                  Found in packages/changelog/docs/js/search/search.js - About 1 hr to fix

                                    Function bindSearch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function bindSearch() {
                                            // Bind DOM
                                            $searchInputs        = $('#book-search-input input');
                                    
                                            $searchResults = $('.search-results');
                                    Severity: Minor
                                    Found in packages/contributors-view/docs/js/search/search.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language