AlexRogalskiy/java-patterns

View on GitHub

Showing 70 of 70 total issues

Function doWork has 35 lines of code (exceeds 25 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 1 hr to fix

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

        var processLogos = function (entityLogos) {
            for (var i = 0; i < entityLogos.length; i++) {
                var entityLogo = entityLogos[i];
                if (entityLogo) {
                    var url = entityLogo.getAttribute('data-src');
    Severity: Minor
    Found in packages/github-client/docs/js/menu.js - About 1 hr to fix

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

          var processLogos = function (entityLogos) {
              for (var i = 0; i < entityLogos.length; i++) {
                  var entityLogo = entityLogos[i];
                  if (entityLogo) {
                      var url = entityLogo.getAttribute('data-src');
      Severity: Minor
      Found in packages/changelog/docs/js/menu.js - About 1 hr to fix

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

            var processLogos = function (entityLogos) {
                for (var i = 0; i < entityLogos.length; i++) {
                    var entityLogo = entityLogos[i];
                    if (entityLogo) {
                        var url = entityLogo.getAttribute('data-src');
        Severity: Minor
        Found in packages/schema-diff/docs/js/menu.js - About 1 hr to fix

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

              var processLogos = function (entityLogos) {
                  for (var i = 0; i < entityLogos.length; i++) {
                      var entityLogo = entityLogos[i];
                      if (entityLogo) {
                          var url = entityLogo.getAttribute('data-src');
          Severity: Minor
          Found in packages/contributors-view/docs/js/menu.js - About 1 hr to fix

            Function init has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const init = async () => {
              const contributorsList: Contributor[] = []
              let page = '1'
            
              // iterate over the pages of GitHub API
            Severity: Minor
            Found in packages/contributors-view/src/index.ts - About 1 hr to fix

              Function toggleItemMenu has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          toggleItemMenu = function (e) {
                              var element = $(e.target),
                                  parent = element[0].parentNode,
                                  parentLink,
                                  elementIconChild;
              Severity: Minor
              Found in packages/github-client/docs/js/menu.js - About 1 hr to fix

                Function toggleItemMenu has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            toggleItemMenu = function (e) {
                                var element = $(e.target),
                                    parent = element[0].parentNode,
                                    parentLink,
                                    elementIconChild;
                Severity: Minor
                Found in packages/schema-diff/docs/js/menu.js - About 1 hr to fix

                  Function toggleItemMenu has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              toggleItemMenu = function (e) {
                                  var element = $(e.target),
                                      parent = element[0].parentNode,
                                      parentLink,
                                      elementIconChild;
                  Severity: Minor
                  Found in packages/changelog/docs/js/menu.js - About 1 hr to fix

                    Function toggleItemMenu has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                toggleItemMenu = function (e) {
                                    var element = $(e.target),
                                        parent = element[0].parentNode,
                                        parentLink,
                                        elementIconChild;
                    Severity: Minor
                    Found in packages/contributors-view/docs/js/menu.js - About 1 hr to fix

                      Function main has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring.
                      Open

                      func main() {
                          flag.Parse()
                      
                          cmd := exec.Command(*entrPath, *entrFlags)
                          cmd.Stdin = strings.NewReader(fmt.Sprintf("%s\n", *watchFile))
                      Severity: Minor
                      Found in tilt_modules/restart_process/tilt-restart-wrapper.go - About 1 hr 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 updateQueryString has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function updateQueryString(key, value) {
                              value = encodeURIComponent(value);
                      
                              var url = window.location.href;
                              var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
                      Severity: Minor
                      Found in packages/changelog/docs/js/search/search.js - About 1 hr to fix

                        Function updateQueryString has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function updateQueryString(key, value) {
                                value = encodeURIComponent(value);
                        
                                var url = window.location.href;
                                var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
                        Severity: Minor
                        Found in packages/contributors-view/docs/js/search/search.js - About 1 hr to fix

                          Function updateQueryString has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function updateQueryString(key, value) {
                                  value = encodeURIComponent(value);
                          
                                  var url = window.location.href;
                                  var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
                          Severity: Minor
                          Found in packages/schema-diff/docs/js/search/search.js - About 1 hr to fix

                            Function getBranchDrift has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              new Promise((resolve, reject) => {
                                let output = ""
                                const delta = spawn("git", [
                                  "rev-list",
                                  "--left-right",
                            Severity: Minor
                            Found in packages/schema-diff/src/index.ts - About 1 hr to fix

                              Function updateQueryString has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function updateQueryString(key, value) {
                                      value = encodeURIComponent(value);
                              
                                      var url = window.location.href;
                                      var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
                              Severity: Minor
                              Found in packages/github-client/docs/js/search/search.js - About 1 hr to fix

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

                                  new Promise((resolve, reject) => {
                                    let changedBlob = ""
                                    const changed = spawn("git", ["diff", "--name-status", "--relative", "origin/master"])
                                    changed.stdout.on("data", (data) => {
                                      changedBlob += data
                                Severity: Minor
                                Found in packages/schema-diff/src/index.ts - About 1 hr to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if (toggler) {
                                                          toggler.click();
                                                      }
                                  Severity: Major
                                  Found in packages/contributors-view/docs/js/menu.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        for(attr in value.attributes) {
                                                            if (DIRECTIVES[i].selector.indexOf(attr) !== -1) {
                                                                newNode.font = {
                                                                    multi: 'html'
                                                                };
                                    Severity: Major
                                    Found in packages/contributors-view/docs/js/tree.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if (toggler) {
                                                              toggler.click();
                                                          }
                                      Severity: Major
                                      Found in packages/changelog/docs/js/menu.js - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language