Skip to content
Open

Test #557

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/on.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@ jobs:
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
- name: Check Sonar inputs
shell: bash
run: |
[ -n "${{ secrets.SONAR_TOKEN }}" ] && echo "SONAR_TOKEN present" || echo "SONAR_TOKEN missing"
[ -n "${{ vars.SONAR_HOST_URL }}" ] && echo "SONAR_HOST_URL present" || echo "SONAR_HOST_URL missing"
[ -n "${{ vars.SONAR_ORG }}" ] && echo "SONAR_ORG present" || echo "SONAR_ORG missing"
[ -n "${{ vars.SONAR_PROJECT_KEY }}" ] && echo "SONAR_PROJECT_KEY present" || echo "SONAR_PROJECT_KEY missing"
- name: Run Sonar Analysis
run: mvn sonar:sonar
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
-Dsonar.host.url=${{ vars.SONAR_HOST_URL }}
-Dsonar.organization=${{ vars.SONAR_ORG }}
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package ca.bc.gov.educ.api.ruleengine.rule;

import ca.bc.gov.educ.api.ruleengine.dto.RuleData;
Expand Down Expand Up @@ -31,9 +31,10 @@
private RuleProcessorData ruleProcessorData;

@Override
public RuleData fire() {

Check failure on line 34 in api/src/main/java/ca/bc/gov/educ/api/ruleengine/rule/RegistrationsFailedCrseRule.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=bcgov_EDUC-RULE-ENGINE-API&issues=AZ7g5MqXBIbLM0SHG-Ju&open=AZ7g5MqXBIbLM0SHG-Ju&pullRequest=557
List<StudentCourse> studentCourseList = ruleProcessorData.getStudentCourses();
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("PST"), Locale.CANADA);
// test comment
boolean inProgressCourse = false;
for (StudentCourse studentCourse : studentCourseList) {
if (RuleEngineApiUtils.isCompletedCourse(studentCourse.getCompletedCourseLetterGrade(), studentCourse.getCompletedCoursePercentage())) {
Expand Down
Loading