From 2dd2bd62864e643800c8d788c51f935dabcc3ace Mon Sep 17 00:00:00 2001 From: Tanmay Sharma Date: Fri, 12 Apr 2024 22:26:37 +0300 Subject: [PATCH 1/2] Code Formatting and Linting --- .../java/com/rultor/agents/github/StartsTalks.java | 9 ++++++++- src/main/js/home.js | 12 ++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rultor/agents/github/StartsTalks.java b/src/main/java/com/rultor/agents/github/StartsTalks.java index 8405dab7f7..a73c89e965 100644 --- a/src/main/java/com/rultor/agents/github/StartsTalks.java +++ b/src/main/java/com/rultor/agents/github/StartsTalks.java @@ -106,13 +106,20 @@ public void execute(final Talks talks) throws IOException { this, "Skipped, since not interesting reason '%s' in %s", reason, url ); - continue; } if (!new IssueUrl(url).valid()) { ++skipped; Logger.info(this, "Skipped, since not valid URL at %s", url); + } + + // Loops should not contain more than a single "break" + // or "continue" + // The use of break and continue statements increases the complexity of the control flow and makes it harder to understand the program logic. In order to keep a good program structure, they should not be applied more than once per loop. + if (!"mention".equals(reason) || !new IssueUrl(url).valid()) { continue; } + + names.add(this.activate(talks, event)); } req.uri() diff --git a/src/main/js/home.js b/src/main/js/home.js index cd4904a78d..7691ba4552 100644 --- a/src/main/js/home.js +++ b/src/main/js/home.js @@ -36,10 +36,14 @@ $(document).ready( var $div = $('#pulse'); window.setInterval( function () { - $div.find('img').attr( - 'src', - $div.attr('data-href') + '?' + Date.now() - ); + // Check whether the #pulse div + // and the img tag does exists + if ($div.length && $div.find('img').length) { + $div.find('img').attr( + 'src', + $div.attr('data-href') + '?' + Date.now() + ); + } }, 1000 ); From 76128cd2c7c1978b6baeb600a7828ca9f45108c6 Mon Sep 17 00:00:00 2001 From: Tanmay Sharma Date: Fri, 12 Apr 2024 22:32:22 +0300 Subject: [PATCH 2/2] Code formatted --- src/main/java/com/rultor/agents/github/StartsTalks.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/com/rultor/agents/github/StartsTalks.java b/src/main/java/com/rultor/agents/github/StartsTalks.java index a73c89e965..dc71060747 100644 --- a/src/main/java/com/rultor/agents/github/StartsTalks.java +++ b/src/main/java/com/rultor/agents/github/StartsTalks.java @@ -112,9 +112,6 @@ public void execute(final Talks talks) throws IOException { Logger.info(this, "Skipped, since not valid URL at %s", url); } - // Loops should not contain more than a single "break" - // or "continue" - // The use of break and continue statements increases the complexity of the control flow and makes it harder to understand the program logic. In order to keep a good program structure, they should not be applied more than once per loop. if (!"mention".equals(reason) || !new IssueUrl(url).valid()) { continue; }