Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonar fixes. #347

Draft
wants to merge 1 commit into
base: grad-release
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.util.List;

import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
Expand All @@ -27,17 +27,15 @@
@RestController
@RequestMapping(EducGradStudentGraduationApiConstants.GRAD_STUDENT_GRADUATION_ALGO_CONTROLLER_ROOT_MAPPING)
@OpenAPIDefinition(info = @Info(title = "API for Algorithm Rule Data.", description = "This API contains endpoints for Algorithm Rule data.", version = "1"), security = {@SecurityRequirement(name = "OAUTH2", scopes = {"READ_GRAD_SPECIAL_CASE_DATA","READ_GRAD_LETTER_GRADE_DATA"})})
@AllArgsConstructor
public class AlgorithmRuleController {

private static Logger logger = LoggerFactory.getLogger(AlgorithmRuleController.class);

@Autowired
AlgorithmRuleService algorithmRuleService;

@Autowired
GradValidation validation;

@Autowired
ResponseHelper response;

@GetMapping(EducGradStudentGraduationApiConstants.GET_ALGORITHM_RULES_MAIN_PROGRAM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import java.util.List;

import lombok.AllArgsConstructor;
import org.modelmapper.TypeToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
Expand Down Expand Up @@ -33,21 +33,18 @@
@RestController
@RequestMapping(EducGradStudentGraduationApiConstants.GRAD_STUDENT_GRADUATION_LGSC_CONTROLLER_ROOT_MAPPING)
@OpenAPIDefinition(info = @Info(title = "API for Letter Grade and Special Case Data.", description = "This API contains endpoints for Letter Grade and Special Case data.", version = "1"), security = {@SecurityRequirement(name = "OAUTH2", scopes = {"READ_GRAD_SPECIAL_CASE_DATA","READ_GRAD_LETTER_GRADE_DATA"})})
@AllArgsConstructor
public class LettergradeSpecialcaseController {

private static Logger logger = LoggerFactory.getLogger(LettergradeSpecialcaseController.class);

@Autowired
LetterGradeService letterGradeService;

@Autowired
SpecialCaseService specialCaseService;
SpecialCaseService specialCaseService;

@Autowired
GradValidation validation;

@Autowired
ResponseHelper response;
ResponseHelper response;


@GetMapping(value=EducGradStudentGraduationApiConstants.GET_ALL_SPECIAL_CASE_MAPPING,produces= {"application/json"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.util.List;

import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
Expand Down Expand Up @@ -32,15 +32,13 @@
@OpenAPIDefinition(info = @Info(title = "API for Transcript Messages Data.", description = "This API is for Transcript Messages Data.", version = "1"), security = {
@SecurityRequirement(name = "OAUTH2", scopes = { "READ_GRAD_UNGRAD_CODE_DATA",
"READ_GRAD_MESSEGING_CODE_DATA" }) })
@AllArgsConstructor
public class TranscriptMessageController {

@Autowired
private TranscriptMessageService transcriptMessageService;

@Autowired
GradValidation validation;

@Autowired
ResponseHelper response;

private static Logger logger = LoggerFactory.getLogger(TranscriptMessageController.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import jakarta.validation.Valid;

import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
Expand Down Expand Up @@ -41,20 +41,17 @@
@RestController
@RequestMapping(EducGradStudentGraduationApiConstants.GRAD_STUDENT_GRADUATION_UNGRAD_REASON_CONTROLLER_ROOT_MAPPING)
@OpenAPIDefinition(info = @Info(title = "API for Student and General Ungrad Reasons.", description = "This API is for Student and General Ungrad Reasons endpoints.", version = "1"), security = {@SecurityRequirement(name = "OAUTH2", scopes = {"READ_GRAD_STUDENT_UNGRAD_REASONS_DATA"})})
@AllArgsConstructor
public class UndoCompletionReasonController {

private static Logger logger = LoggerFactory.getLogger(UndoCompletionReasonController.class);

@Autowired
StudentUndoCompletionReasonService studentUndoCompletionReasonService;

@Autowired
UndoCompletionReasonService ungradReasonService;

@Autowired
GradValidation validation;

@Autowired
ResponseHelper response;

private static final String REASON_CODE="Reason Code";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

Expand All @@ -11,9 +10,9 @@
import ca.bc.gov.educ.api.studentgraduation.repository.TranscriptMessageRepository;
import ca.bc.gov.educ.api.studentgraduation.util.EducGradStudentGraduationApiConstants;
import ca.bc.gov.educ.api.studentgraduation.util.ThreadLocalStateUtil;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
Expand All @@ -29,42 +28,31 @@


@Service
@AllArgsConstructor
public class AlgorithmRuleService {

@Autowired
private ProgramAlgorithmRuleTransformer programAlgorithmRuleTransformer;

@Autowired
private ProgramAlgorithmRuleRepository programAlgorithmRuleRepository;

@Autowired
private LetterGradeTransformer letterGradeTransformer;

@Autowired
private LetterGradeRepository letterGradeRepository;
private LetterGradeRepository letterGradeRepository;

@Autowired
private SpecialCaseTransformer specialCaseTransformer;

@Autowired
private SpecialCaseRepository specialCaseRepository;

@Autowired
private TranscriptMessageTransformer transcriptMessageTransformer;

@Autowired
private TranscriptMessageRepository transcriptMessageRepository;

@Autowired
WebClient webClient;

@Autowired
RestTemplate restTemplate;

@Autowired
GradValidation validation;

@Autowired
EducGradStudentGraduationApiConstants constants;

@SuppressWarnings("unused")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import java.util.List;
import java.util.Optional;

import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;
Expand All @@ -18,21 +18,17 @@
import ca.bc.gov.educ.api.studentgraduation.util.GradValidation;

@Service
@AllArgsConstructor
public class LetterGradeService {

@Autowired
private LetterGradeTransformer letterGradeTransformer;

@Autowired
private LetterGradeRepository letterGradeRepository;
private LetterGradeRepository letterGradeRepository;

@Autowired
GradValidation validation;

@Autowired
RestTemplate restTemplate;

@Autowired
WebClient webClient;

@SuppressWarnings("unused")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import java.util.List;
import java.util.Optional;

import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ca.bc.gov.educ.api.studentgraduation.model.dto.SpecialCase;
Expand All @@ -16,15 +16,13 @@
import ca.bc.gov.educ.api.studentgraduation.util.GradValidation;

@Service
@AllArgsConstructor
public class SpecialCaseService {

@Autowired
private SpecialCaseTransformer specialCaseTransformer;

@Autowired
private SpecialCaseRepository specialCaseRepository;
private SpecialCaseRepository specialCaseRepository;

@Autowired
GradValidation validation;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import jakarta.transaction.Transactional;
import jakarta.validation.Valid;

import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;
Expand All @@ -24,24 +24,19 @@


@Service
@AllArgsConstructor
public class StudentUndoCompletionReasonService {

@Autowired
private StudentUndoCompletionReasonTransformer studentUndoCompletionReasonTransformer;

@Autowired
private StudentUndoCompletionReasonRepository studentUndoCompletionReasonRepository;
private StudentUndoCompletionReasonRepository studentUndoCompletionReasonRepository;

@Autowired
private UndoCompletionReasonService undoCompletionReasonService;

@Autowired
WebClient webClient;

@Autowired
RestTemplate restTemplate;

@Autowired
GradValidation validation;

@SuppressWarnings("unused")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;

Expand All @@ -12,19 +12,17 @@
import ca.bc.gov.educ.api.studentgraduation.model.transformer.TranscriptMessageTransformer;
import ca.bc.gov.educ.api.studentgraduation.repository.TranscriptMessageRepository;
import ca.bc.gov.educ.api.studentgraduation.util.GradValidation;

@Service
@AllArgsConstructor
public class TranscriptMessageService {

@Autowired
private TranscriptMessageRepository transcriptMessageRepository;

@Autowired
private TranscriptMessageTransformer transcriptMessageTransformer;

@Autowired
GradValidation validation;

@Autowired
WebClient webClient;

public List<TranscriptMessage> getAllTranscriptMessageList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import ca.bc.gov.educ.api.studentgraduation.repository.StudentUndoCompletionReasonRepository;
import ca.bc.gov.educ.api.studentgraduation.repository.UndoCompletionReasonRepository;
import ca.bc.gov.educ.api.studentgraduation.util.GradValidation;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;
Expand All @@ -20,24 +20,19 @@
import java.util.Optional;

@Service
@AllArgsConstructor
public class UndoCompletionReasonService {

@Autowired
private UndoCompletionReasonRepository undoCompletionReasonRepository;

@Autowired
private UndoCompletionReasonTransformer undoCompletionReasonTransformer;

@Autowired
private StudentUndoCompletionReasonRepository studentUndoCompletionReasonRepository;

@Autowired
GradValidation validation;
GradValidation validation;

@Autowired
WebClient webClient;

@Autowired
RestTemplate restTemplate;

private static final String CREATED_BY="createdBy";
Expand Down
Loading
Loading