From 8849c4d9cbb95573ad213d25f3e4743fe2341234 Mon Sep 17 00:00:00 2001 From: Kaja Kvinge Akselsen Date: Wed, 19 Jun 2024 12:31:19 +0200 Subject: [PATCH] Remove shadow Add detekt Remove ktlint --- build.gradle.kts | 36 ++-- detekt-baseline.xml | 388 ++++++++++++++++++++++++++++++++++++++++++++ detekt-config.yml | 6 + 3 files changed, 409 insertions(+), 21 deletions(-) create mode 100644 detekt-baseline.xml create mode 100644 detekt-config.yml diff --git a/build.gradle.kts b/build.gradle.kts index b13ac5ca..41c22930 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,3 @@ -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -import com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTransformer - group = "no.nav.syfo" val apacheHttpClientVersion = "5.3.1" @@ -22,15 +19,16 @@ val jakartaRsApiVersion = "3.1.0" val hikari = "5.1.0" val postgres = "42.7.3" val postgresEmbedded = "1.0.0" +val detektVersion = "1.23.6" plugins { id("java") - kotlin("jvm") version "1.9.24" + kotlin("jvm") version "1.9.23" id("com.github.johnrengelman.shadow") version "7.1.2" - id("org.jetbrains.kotlin.plugin.allopen") version "1.9.24" + id("org.jetbrains.kotlin.plugin.allopen") version "1.9.23" id("org.springframework.boot") version "3.3.0" id("io.spring.dependency-management") version "1.1.5" - id("org.jlleitschuh.gradle.ktlint") version "10.0.0" + id("io.gitlab.arturbosch.detekt") version "1.23.6" } allOpen { @@ -122,6 +120,8 @@ dependencies { } } } + + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion") } java.toolchain { @@ -131,24 +131,18 @@ java.toolchain { tasks { extra["log4j2.version"] = "2.16.0" - withType { - manifest.attributes["Main-Class"] = "no.nav.syfo.ApplicationKt" - transform(PropertiesFileTransformer::class.java) { - paths = listOf("META-INF/spring.factories") - mergeStrategy = "append" - isZip64 = true - } - configureEach { - append("META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports") - append("META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports") - } - mergeServiceFiles() - archiveBaseName.set("app") - archiveClassifier.set("") - archiveVersion.set("") + named("bootJar") { + this.archiveFileName.set("app.jar") } withType { useJUnitPlatform() } } + +detekt { + config.from("detekt-config.yml") + buildUponDefaultConfig = true + baseline = file("detekt-baseline.xml") +} + diff --git a/detekt-baseline.xml b/detekt-baseline.xml new file mode 100644 index 00000000..7a8b1616 --- /dev/null +++ b/detekt-baseline.xml @@ -0,0 +1,388 @@ + + + + + AnnotationOnSeparateLine:MotebehovArbeidsgiverControllerV3.kt$MotebehovArbeidsgiverControllerV3$@Pattern(regexp = "^[0-9]{11}$") + AnnotationOnSeparateLine:MotebehovVeilederADControllerV3.kt$MotebehovVeilederADControllerV3$@Pattern(regexp = "^[0-9]{11}$") + ArgumentListWrapping:AzureAdV2TokenConsumer.kt$AzureAdV2TokenConsumer$("Call to get AzureADV2Token from AzureAD for scope: $scopeClientId with status: ${e.rawStatusCode} and message: ${e.responseBodyAsString}", e) + ArgumentListWrapping:BehandleUbehandleteMotebehovScheduler.kt$BehandleUbehandleteMotebehovScheduler$("Running BehandleUbehandleteMotebehovScheduler job. Behandler ubehandlede møtebehov opprettet tidligere enn $dato") + ArgumentListWrapping:BehandleUbehandleteMotebehovScheduler.kt$BehandleUbehandleteMotebehovScheduler$(dato, fakeVeilederIdent) + ArgumentListWrapping:BehandlendeEnhetConsumer.kt$BehandlendeEnhetConsumer$("Error requesting BehandlendeEnhet from syfobehandlendeenhet with callId ${httpEntity.headers[NAV_CALL_ID_HEADER]}: ", e) + ArgumentListWrapping:BrukertilgangConsumer.kt$BrukertilgangConsumer$("Unauthorized request to get access to Ansatt from Syfobrukertilgang") + ArgumentListWrapping:BrukertilgangConsumer.kt$BrukertilgangConsumer$(RequestUnauthorizedException("Unauthorized request to get access to Ansatt from Syfobrukertilgang")) + ArgumentListWrapping:BrukertilgangService.kt$BrukertilgangService$("Ikke tilgang til arbeidstaker: inlogget person har ikke tilgang til den ansatte eller den ansatte er gradert for informasjon") + ArgumentListWrapping:ControllerExceptionHandler.kt$ControllerExceptionHandler$("Fikk response med kode : {} : {} : {}", status.value(), ex.javaClass.toString(), ex.message, ex) + ArgumentListWrapping:ControllerExceptionHandler.kt$ControllerExceptionHandler$(Exception::class, IllegalArgumentException::class, ConstraintViolationException::class, ForbiddenException::class, JwtTokenUnauthorizedException::class) + ArgumentListWrapping:ControllerExceptionHandler.kt$ControllerExceptionHandler$(HttpStatus.BAD_REQUEST.value(), BAD_REQUEST_MSG) + ArgumentListWrapping:ControllerExceptionHandler.kt$ControllerExceptionHandler$(HttpStatus.FORBIDDEN.value(), FORBIDDEN_MSG) + ArgumentListWrapping:ControllerExceptionHandler.kt$ControllerExceptionHandler$(HttpStatus.UNAUTHORIZED.value(), UNAUTHORIZED_MSG) + ArgumentListWrapping:ControllerExceptionHandler.kt$ControllerExceptionHandler$(ex, ApiError(HttpStatus.BAD_REQUEST.value(), BAD_REQUEST_MSG), headers, HttpStatus.BAD_REQUEST, request) + ArgumentListWrapping:ControllerExceptionHandler.kt$ControllerExceptionHandler$(ex, ApiError(HttpStatus.FORBIDDEN.value(), FORBIDDEN_MSG), headers, HttpStatus.FORBIDDEN, request) + ArgumentListWrapping:ControllerExceptionHandler.kt$ControllerExceptionHandler$(ex, ApiError(HttpStatus.UNAUTHORIZED.value(), UNAUTHORIZED_MSG), headers, HttpStatus.UNAUTHORIZED, request) + ArgumentListWrapping:DbUtil.kt$DbUtil$( """ Dette er ikke en feil, men burde vært stoppet av regexen i frontend. Finn ut hvorfor og evt. oppdater regex. Det ble strippet vekk innhold slik at denne teksten: {} ble til denne teksten: {} """.trimIndent(), userinput, sanitizedInput ) + ArgumentListWrapping:DbUtil.kt$DbUtil$(StringEscapeUtils.unescapeHtml4(userinput)) + ArgumentListWrapping:DbUtil.kt$DbUtil$(sanitizer.sanitize(StringEscapeUtils.unescapeHtml4(userinput))) + ArgumentListWrapping:DbUtil.kt$DbUtil$(userinput) + ArgumentListWrapping:DialogmoteStatusServiceTest.kt$DialogmoteStatusServiceTest$( UserConstants.ARBEIDSTAKER_FNR, UserConstants.VIRKSOMHETSNUMMER, externMoteUUID ) + ArgumentListWrapping:DialogmoteStatusServiceTest.kt$DialogmoteStatusServiceTest$( externMoteUUID, DialogmoteStatusEndringType.AVLYST, null ) + ArgumentListWrapping:DialogmoteStatusServiceTest.kt$DialogmoteStatusServiceTest$( externMoteUUID, DialogmoteStatusEndringType.INNKALT, null ) + ArgumentListWrapping:DialogmoteStatusServiceTest.kt$DialogmoteStatusServiceTest$( externMoteUUID, DialogmoteStatusEndringType.NYTT_TID_STED, null ) + ArgumentListWrapping:DialogmoteStatusendringListener.kt$DialogmoteStatusendringListener$("Got record from $DIALOGMOTE_STATUSENDRING_TOPIC topic for dialogmoteUuid: ${consumerRecord.value().getDialogmoteUuid()}") + ArgumentListWrapping:DialogmotekandidatService.kt$DialogmotekandidatService$("Mottok kandidatmelding med kandidatstatus ${dialogmotekandidatEndring.kandidat} og arsak ${dialogmotekandidatEndring.arsak}") + ArgumentListWrapping:DialogmotekandidatService.kt$DialogmotekandidatService$(dialogmotekandidatEndring.createdAt.toNorwegianLocalDateTime()) + ArgumentListWrapping:EsyfovarselKafkaConfig.kt$EsyfovarselKafkaConfig$("EsyfovarselProducerFactory") + ArgumentListWrapping:Metric.kt$Metric$( "type", "info", "kode", kode.toString() ) + ArgumentListWrapping:Metric.kt$Metric$( "type", "info", "motebehov", if (harMotebehov) "ja" else "nei", "dag", dayInOppfolgingstilfelleMotebehovCreated?.toString().orEmpty(), "skjematype", when (motebehovSkjemaType) { MotebehovSkjemaType.MELD_BEHOV -> "meldbehov" MotebehovSkjemaType.SVAR_BEHOV -> "svarbehov" else -> "null" } ) + ArgumentListWrapping:Metric.kt$Metric$( "type", "info", "status", statusCode.toString() ) + ArgumentListWrapping:Metric.kt$Metric$(activeOppfolgingstilfelle.fom, LocalDate.now()) + ArgumentListWrapping:MotebehovArbeidsgiverControllerV3.kt$MotebehovArbeidsgiverControllerV3$(issuer = TokenXIssuer.TOKENX, claimMap = ["acr=Level4", "acr=idporten-loa-high"], combineWithOr = true) + ArgumentListWrapping:MotebehovArbeidstakerControllerV3.kt$MotebehovArbeidstakerControllerV3$(issuer = TokenXIssuer.TOKENX, claimMap = ["acr=Level4", "acr=idporten-loa-high"], combineWithOr = true) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$("SELECT * FROM motebehov WHERE aktoer_id = ? AND har_motebehov AND behandlet_veileder_ident IS NULL", innsendingRowMapper, aktoerId) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$("SELECT * FROM motebehov WHERE aktoer_id = ? AND opprettet_av != ? AND virksomhetsnummer = ? AND opprettet_dato >= ? ORDER BY opprettet_dato DESC", innsendingRowMapper, arbeidstakerAktorId, arbeidstakerAktorId, virksomhetsnummer, hentTidligsteDatoForGyldigMotebehovSvar()) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$("SELECT * FROM motebehov WHERE aktoer_id = ? AND opprettet_av = ? AND opprettet_dato >= ? ORDER BY opprettet_dato DESC", innsendingRowMapper, arbeidstakerAktorId, arbeidstakerAktorId, hentTidligsteDatoForGyldigMotebehovSvar()) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$("SELECT * FROM motebehov WHERE aktoer_id = ? AND virksomhetsnummer = ? AND opprettet_dato >= ? ORDER BY opprettet_dato DESC", innsendingRowMapper, arbeidstakerAktorId, virksomhetsnummer, hentTidligsteDatoForGyldigMotebehovSvar()) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$("SELECT * FROM motebehov WHERE aktoer_id = ? ORDER BY opprettet_dato ASC", innsendingRowMapper, aktoerId) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$("SELECT * FROM motebehov WHERE motebehov_uuid = ?", innsendingRowMapper, motebehovId) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$("SELECT * FROM motebehov WHERE opprettet_dato < ? AND har_motebehov AND behandlet_veileder_ident IS NULL", innsendingRowMapper, convert(date)) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$(date) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$(emptyList()) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? AND har_motebehov AND behandlet_veileder_ident IS NULL", innsendingRowMapper, aktoerId)) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? AND opprettet_av != ? AND virksomhetsnummer = ? AND opprettet_dato >= ? ORDER BY opprettet_dato DESC", innsendingRowMapper, arbeidstakerAktorId, arbeidstakerAktorId, virksomhetsnummer, hentTidligsteDatoForGyldigMotebehovSvar())) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? AND opprettet_av = ? AND opprettet_dato >= ? ORDER BY opprettet_dato DESC", innsendingRowMapper, arbeidstakerAktorId, arbeidstakerAktorId, hentTidligsteDatoForGyldigMotebehovSvar())) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? AND virksomhetsnummer = ? AND opprettet_dato >= ? ORDER BY opprettet_dato DESC", innsendingRowMapper, arbeidstakerAktorId, virksomhetsnummer, hentTidligsteDatoForGyldigMotebehovSvar())) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? ORDER BY opprettet_dato ASC", innsendingRowMapper, aktoerId)) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$(jdbcTemplate.query("SELECT * FROM motebehov WHERE motebehov_uuid = ?", innsendingRowMapper, motebehovId)) + ArgumentListWrapping:MotebehovDAO.kt$MotebehovDAO$(jdbcTemplate.query("SELECT * FROM motebehov WHERE opprettet_dato < ? AND har_motebehov AND behandlet_veileder_ident IS NULL", innsendingRowMapper, convert(date))) + ArgumentListWrapping:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$("Failed to create Motebehov for Arbeidsgiver: Found no Virksomhetsnummer with active Oppfolgingstilfelle available for answer") + ArgumentListWrapping:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$("Failed to create Motebehov for Arbeidsgiver: Found no active Oppfolgingstilfelle for ${nyttMotebehov.virksomhetsnummer}") + ArgumentListWrapping:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$("Failed to create Motebehov for Arbeidstaker: Found no Virksomhetsnummer with active Oppfolgingstilfelle") + ArgumentListWrapping:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$(arbeidstakerFnr) + ArgumentListWrapping:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$(arbeidstakerFnr, innloggetFnr, nyttMotebehov.virksomhetsnummer) + ArgumentListWrapping:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$(arbeidstakerFnr, isOwnLeader, nyttMotebehov.virksomhetsnummer) + ArgumentListWrapping:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$(arbeidstakerFnr, nyttMotebehov.virksomhetsnummer) + ArgumentListWrapping:MotebehovServiceTest.kt$MotebehovServiceTest$(1) + ArgumentListWrapping:MotebehovServiceTest.kt$MotebehovServiceTest$(LocalDate.now().minusWeeks(1), veilederIdent) + ArgumentListWrapping:MotebehovServiceTest.kt$MotebehovServiceTest$(LocalDate.now().plusWeeks(1), veilederIdent) + ArgumentListWrapping:MotebehovStatusServiceV2.kt$MotebehovStatusServiceV2$(hasUpcomingDialogmote, oppfolgingstilfelle, isDialogmoteKandidat, motebehovList) + ArgumentListWrapping:NullstillMotebehovController.kt$NullstillMotebehovController$("Det ble gjort kall mot 'nullstill', men dette endepunktet er togglet av og skal aldri brukes i prod.") + ArgumentListWrapping:OppfolgingstilfelleService.kt$OppfolgingstilfelleService$(1) + ArgumentListWrapping:OppfolgingstilfelleService.kt$OppfolgingstilfelleService$(activeOppfolgingstilfelleList.minByOrNull { it.fom }!!.fom.minusDays(1)) + ArgumentListWrapping:OppfolgingstilfelleService.kt$OppfolgingstilfelleService$(arbeidstakerFnr) + ArgumentListWrapping:OppfolgingstilfelleService.kt$OppfolgingstilfelleService$(arbeidstakerFnr, getPOppfolgingstilfellerInActiveOppfolgingstilfelle(arbeidstakerFnr)) + ArgumentListWrapping:PersonoppgavehendelseKafkaConfig.kt$PersonoppgavehendelseKafkaConfig$("PersonoppgavehendelseProducerFactory") + ArgumentListWrapping:PersonoppgavehendelseProducer.kt$PersonoppgavehendelseProducer$("PersonoppgavehendelseTemplate") + ArgumentListWrapping:PersonoppgavehendelseProducer.kt$PersonoppgavehendelseProducer$("Sending personoppgavehendelse of type ${kPersonoppgavehendelse.hendelsetype}, personoppgaveId: $personoppgaveId") + ArgumentListWrapping:RestHelper.kt$(HttpHeaders.AUTHORIZATION, bearerCredentials(systemToken.access_token)) + ArgumentListWrapping:RestHelper.kt$(MockRestRequestMatchers.header(HttpHeaders.AUTHORIZATION, bearerCredentials(systemToken.access_token))) + ArgumentListWrapping:RestHelper.kt$(systemToken.access_token) + ArgumentListWrapping:TestdataResetServiceTest.kt$TestdataResetServiceTest$(1) + ArgumentListWrapping:TestdataResetServiceTest.kt$TestdataResetServiceTest$(ARBEIDSTAKER_FNR, LocalDate.now().minusDays(1)) + ArgumentListWrapping:TestdataResetServiceTest.kt$TestdataResetServiceTest$(PMotebehov(UUID.randomUUID(), LocalDateTime.now(), "meg", ARBEIDSTAKER_AKTORID, VIRKSOMHETSNUMMER, true)) + ArgumentListWrapping:TestdataResetServiceTest.kt$TestdataResetServiceTest$(UUID.randomUUID(), LocalDateTime.now(), "meg", ARBEIDSTAKER_AKTORID, VIRKSOMHETSNUMMER, true) + ArgumentListWrapping:TestdataResetServiceTest.kt$TestdataResetServiceTest$(UUID.randomUUID().toString(), LocalDateTime.now(), ARBEIDSTAKER_FNR, true, DialogmotekandidatEndringArsak.STOPPUNKT.name) + ArgumentListWrapping:TestdataResetServiceTest.kt$TestdataResetServiceTest$(UUID.randomUUID().toString(), LocalDateTime.now(), LocalDateTime.now(), DialogmoteStatusEndringType.INNKALT.name, ARBEIDSTAKER_FNR, VIRKSOMHETSNUMMER) + ArgumentListWrapping:TestdataResetServiceTest.kt$TestdataResetServiceTest$(dialogmoteDAO.getAktiveDialogmoterEtterDato(ARBEIDSTAKER_FNR, LocalDate.now().minusDays(1))) + ArgumentListWrapping:VarselServiceV2.kt$VarselServiceV2$("Antall unike nærmeste ledere for kandidatUuid $kandidatUuid: ${narmesteLederRelations?.size ?: 0}, antall virksomheter: $amountOfVirksomheter") + ArgumentListWrapping:VarselServiceV2.kt$VarselServiceV2$("Not sending Varsel to Arbeidstaker because Møtebehov is not available for the combination of Arbeidstaker and Virksomhet") + ArgumentListWrapping:VarselServiceV2.kt$VarselServiceV2$("Not sending Varsel to Narmeste Leder because Møtebehov is not available for the combination of Arbeidstaker and Virksomhet") + ArgumentListWrapping:VarselServiceV2.kt$VarselServiceV2$(ansattFnr, ansattesOppfolgingstilfelle?.fom ?: LocalDate.now()) + ArgumentListWrapping:VarselServiceV2.kt$VarselServiceV2$(ansattFnr, it.narmesteLederPersonIdentNumber, it.virksomhetsnummer) + ConstructorParameterNaming:AzureAdV2TokenResponse.kt$AzureAdV2TokenResponse$val access_token: String + ConstructorParameterNaming:AzureAdV2TokenResponse.kt$AzureAdV2TokenResponse$val expires_in: Long + ConstructorParameterNaming:TokenXResponse.kt$TokenXResponse$val access_token: String + ConstructorParameterNaming:TokenXResponse.kt$TokenXResponse$val expires_in: Long + ConstructorParameterNaming:TokenXResponse.kt$TokenXResponse$val issued_token_type: String + ConstructorParameterNaming:TokenXResponse.kt$TokenXResponse$val token_type: String + EmptyDefaultConstructor:TokenValidationUtil.kt$TokenValidationUtil$() + EmptyFunctionBlock:ApplicationConfigTest.kt$ApplicationConfigTest${ } + EmptyFunctionBlock:FunctionSerializer.kt$FunctionSerializer${} + EmptyFunctionBlock:IsOppfolgingstilfelleKafkaConfig.kt$KafkaIsOppfolgingstilfelleDeserializer${} + EmptyFunctionBlock:JacksonKafkaSerializer.kt$JacksonKafkaSerializer${} + EmptyFunctionBlock:KafkaDialogmotekandidatDeserializer.kt$KafkaDialogmotekandidatDeserializer${} + ExplicitItLambdaParameter:KafkaOppfolgingstilfellePerson.kt${ it -> this.createdAt.toNorwegianLocalDateTime().isBefore(it) } + FunctionOnlyReturningConstant:PodController.kt$PodController$@Unprotected @RequestMapping(value = ["/isAlive"], produces = [MediaType.TEXT_PLAIN_VALUE]) fun isAlive(): String + FunctionOnlyReturningConstant:PodController.kt$PodController$@Unprotected @RequestMapping(value = ["/isReady"], produces = [MediaType.TEXT_PLAIN_VALUE]) fun isReady(): String + ImportOrdering:DialogmoteDAO.kt$import java.time.LocalDate import java.time.LocalDateTime import java.util.* import javax.inject.Inject import no.nav.syfo.util.convert import org.springframework.jdbc.core.RowMapper import org.springframework.jdbc.core.namedparam.MapSqlParameterSource import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate import org.springframework.stereotype.Repository import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional + ImportOrdering:DialogmoteStatusService.kt$import java.time.LocalDate import javax.inject.Inject import no.nav.syfo.dialogmote.avro.KDialogmoteStatusEndring import no.nav.syfo.dialogmote.database.DialogmoteDAO import no.nav.syfo.dialogmote.database.Dialogmote import no.nav.syfo.dialogmote.database.DialogmoteStatusEndringType import no.nav.syfo.util.convertInstantToLocalDateTime import no.nav.syfo.varsel.VarselServiceV2 import org.slf4j.LoggerFactory import org.springframework.stereotype.Service + ImportOrdering:IsOppfolgingstilfelleKafkaConfig.kt$import no.nav.syfo.config.kafka.KafkaAivenConfig import no.nav.syfo.dialogmotekandidat.kafka.configuredJacksonMapper import no.nav.syfo.oppfolgingstilfelle.kafka.domain.KafkaOppfolgingstilfellePerson import org.apache.kafka.clients.consumer.ConsumerConfig import org.apache.kafka.common.serialization.StringDeserializer import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.kafka.annotation.EnableKafka import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory import org.springframework.kafka.core.ConsumerFactory import org.springframework.kafka.core.DefaultKafkaConsumerFactory import org.springframework.kafka.listener.ContainerProperties import org.apache.kafka.common.errors.SerializationException import org.apache.kafka.common.serialization.Deserializer import org.springframework.beans.factory.annotation.Value + ImportOrdering:KafkaTestdataResetConfig.kt$import no.nav.syfo.config.kafka.KafkaAivenConfig import org.apache.kafka.clients.consumer.ConsumerConfig import org.apache.kafka.common.serialization.StringDeserializer import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.kafka.annotation.EnableKafka import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory import org.springframework.kafka.core.ConsumerFactory import org.springframework.kafka.core.DefaultKafkaConsumerFactory import org.springframework.kafka.listener.ContainerProperties import org.springframework.beans.factory.annotation.Value + ImportOrdering:PersonoppgavehendelseKafkaConfig.kt$import javax.inject.Inject import no.nav.syfo.config.kafka.KafkaAivenConfig import no.nav.syfo.personoppgavehendelse.domain.KPersonoppgavehendelse import org.springframework.beans.factory.annotation.Qualifier import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.kafka.annotation.EnableKafka import org.springframework.kafka.core.* + ImportOrdering:PersonoppgavehendelseProducer.kt$import java.util.* import no.nav.syfo.personoppgavehendelse.domain.KPersonoppgavehendelse import org.apache.kafka.clients.producer.ProducerRecord import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Qualifier import org.springframework.kafka.core.KafkaTemplate import org.springframework.stereotype.Component + ImportOrdering:PersonoppgavehendelseService.kt$import java.util.* import javax.inject.Inject import no.nav.syfo.personoppgavehendelse.domain.KPersonoppgavehendelse import no.nav.syfo.personoppgavehendelse.domain.PersonoppgavehendelseType import org.springframework.stereotype.Service + InvalidPackageDeclaration:KafkaTestdataResetConfig.kt$package no.nav.syfo.oppfolgingstilfelle.kafka + InvalidPackageDeclaration:ObjectMapperConfig.kt$package no.nav.syfo.dialogmotekandidat.kafka + InvalidPackageDeclaration:TestdataResetListener.kt$package no.nav.syfo.oppfolgingstilfelle.kafka + LongParameterList:DialogmoteDAO.kt$DialogmoteDAO$( moteExternUUID: String, dialogmoteTidspunkt: LocalDateTime, statusEndringTidspunkt: LocalDateTime, statusEndringType: String, fnr: String, virksomhetsnummer: String, ) + LongParameterList:KafkaDialogmoteStatusConfig.kt$KafkaDialogmoteStatusConfig$( @Value("\${kafka.brokers}") private val aivenBrokers: String, @Value("\${kafka.truststore.path}") private val aivenTruststoreLocation: String, @Value("\${kafka.keystore.path}") private val aivenKeystoreLocation: String, @Value("\${kafka.credstore.password}") private val aivenCredstorePassword: String, @Value("\${app.name}") private val appName: String, @Value("\${kafka.env.name}") private val kafkaEnv: String, @Value("\${kafka.schema.registry.user}") private val aivenRegistryUser: String, @Value("\${kafka.schema.registry.password}") private val aivenRegistryPassword: String, @Value("\${kafka.schema.registry}") private val aivenSchemaRegistryUrl: String, ) + LongParameterList:MotebehovArbeidstakerControllerV3.kt$MotebehovArbeidstakerControllerV3$( private val contextHolder: TokenValidationContextHolder, private val metric: Metric, private val motebehovStatusServiceV2: MotebehovStatusServiceV2, private val motebehovOppfolgingstilfelleServiceV2: MotebehovOppfolgingstilfelleServiceV2, @Value("\${dialogmote.frontend.client.id}") val dialogmoteClientId: String, @Value("\${ditt.sykefravaer.frontend.client.id}") val dittSykefravaerClientId: String, @Value("\${esyfo-proxy.client.id}") val esyfoProxyClientId: String, ) + LongParameterList:MotebehovService.kt$MotebehovService$( innloggetAktoerId: String, arbeidstakerAktoerId: String, innloggetFnr: String, arbeidstakerFnr: String, tildeltEnhet: String, virksomhetsnummer: String, skjemaType: MotebehovSkjemaType, motebehovSvar: MotebehovSvar, ) + LongParameterList:MotebehovVeilederADControllerV3.kt$MotebehovVeilederADControllerV3$( private val contextHolder: TokenValidationContextHolder, private val metric: Metric, private val historikkService: HistorikkService, private val motebehovService: MotebehovService, private val pdlConsumer: PdlConsumer, private val veilederTilgangConsumer: VeilederTilgangConsumer, private val esyfovarselService: EsyfovarselService, ) + LongParameterList:RestHelper.kt$( azureTokenEndpoint: String, mockRestServiceServerAzureAD: MockRestServiceServer, mockRestServiceServer: MockRestServiceServer, behandlendeenhetUrl: String, tilgangskontrollUrl: String, fnr: String, ) + LongParameterList:SyfoTilgangskontrollMock.kt$( azureTokenEndpoint: String, tilgangskontrollUrl: String, mockRestServiceServerAzureAD: MockRestServiceServer, mockRestServiceServer: MockRestServiceServer, fnr: String, status: HttpStatus, ) + LongParameterList:VarselServiceV2.kt$VarselServiceV2$( private val metric: Metric, private val motebehovService: MotebehovService, private val motebehovStatusHelper: MotebehovStatusHelper, private val oppfolgingstilfelleService: OppfolgingstilfelleService, private val esyfovarselService: EsyfovarselService, private val narmesteLederService: NarmesteLederService, private val dialogmoteDAO: DialogmoteDAO ) + MaxLineLength:AzureAdV2TokenConsumer.kt$AzureAdV2TokenConsumer$"Call to get AzureADV2Token from AzureAD as system for scope: $scopeClientId with status: ${e.rawStatusCode} and message: ${e.responseBodyAsString}" + MaxLineLength:AzureAdV2TokenConsumer.kt$AzureAdV2TokenConsumer$log.error("Call to get AzureADV2Token from AzureAD for scope: $scopeClientId with status: ${e.rawStatusCode} and message: ${e.responseBodyAsString}", e) + MaxLineLength:BehandleUbehandleteMotebehovScheduler.kt$BehandleUbehandleteMotebehovScheduler$log.info("Running BehandleUbehandleteMotebehovScheduler job. Behandler ubehandlede møtebehov opprettet tidligere enn $dato") + MaxLineLength:BehandleUbehandleteMotebehovScheduler.kt$BehandleUbehandleteMotebehovScheduler$val updatedCount = motebehovService.behandleUbehandledeMotebehovOpprettetTidligereEnnDato(dato, fakeVeilederIdent) + MaxLineLength:BehandlendeEnhetConsumer.kt$BehandlendeEnhetConsumer$LOG.error("Error requesting BehandlendeEnhet from syfobehandlendeenhet with callId ${httpEntity.headers[NAV_CALL_ID_HEADER]}: ", e) + MaxLineLength:BrukertilgangConsumer.kt$BrukertilgangConsumer$Mono.error(RequestUnauthorizedException("Unauthorized request to get access to Ansatt from Syfobrukertilgang")) + MaxLineLength:BrukertilgangService.kt$BrukertilgangService$throw ForbiddenException("Ikke tilgang til arbeidstaker: inlogget person har ikke tilgang til den ansatte eller den ansatte er gradert for informasjon") + MaxLineLength:ControllerExceptionHandler.kt$ControllerExceptionHandler$@ExceptionHandler(Exception::class, IllegalArgumentException::class, ConstraintViolationException::class, ForbiddenException::class, JwtTokenUnauthorizedException::class) + MaxLineLength:ControllerExceptionHandler.kt$ControllerExceptionHandler$log.warn("Fikk response med kode : {} : {} : {}", status.value(), ex.javaClass.toString(), ex.message, ex) + MaxLineLength:ControllerExceptionHandler.kt$ControllerExceptionHandler$private + MaxLineLength:ControllerExceptionHandler.kt$ControllerExceptionHandler$return handleExceptionInternal(ex, ApiError(HttpStatus.BAD_REQUEST.value(), BAD_REQUEST_MSG), headers, HttpStatus.BAD_REQUEST, request) + MaxLineLength:ControllerExceptionHandler.kt$ControllerExceptionHandler$return handleExceptionInternal(ex, ApiError(HttpStatus.FORBIDDEN.value(), FORBIDDEN_MSG), headers, HttpStatus.FORBIDDEN, request) + MaxLineLength:ControllerExceptionHandler.kt$ControllerExceptionHandler$return handleExceptionInternal(ex, ApiError(HttpStatus.UNAUTHORIZED.value(), UNAUTHORIZED_MSG), headers, HttpStatus.UNAUTHORIZED, request) + MaxLineLength:CredentialUtil.kt$return "Basic " + Base64.getEncoder().encodeToString(java.lang.String.format("%s:%s", credentialUsername, credentialPassword).toByteArray()) + MaxLineLength:DbUtil.kt$DbUtil$val sanitizedInput = StringEscapeUtils.unescapeHtml4(sanitizer.sanitize(StringEscapeUtils.unescapeHtml4(userinput))) + MaxLineLength:DialogmoteStatusendringListener.kt$DialogmoteStatusendringListener$LOG.info("Got record from $DIALOGMOTE_STATUSENDRING_TOPIC topic for dialogmoteUuid: ${consumerRecord.value().getDialogmoteUuid()}") + MaxLineLength:DialogmotekandidatKafkaConfig.kt$DialogmotekandidatKafkaConfig$fun + MaxLineLength:DialogmotekandidatKafkaConfig.kt$DialogmotekandidatKafkaConfig$kafkaAivenConfig.commonKafkaAivenConfig() + kafkaAivenConfig.commonKafkaAivenConsumerConfig() + kafkaDialogmotekandidatConsumerConfig() + MaxLineLength:DialogmotekandidatService.kt$DialogmotekandidatService$existingKandidat.createdAt.isEqualOrAfter(dialogmotekandidatEndring.createdAt.toNorwegianLocalDateTime()) + MaxLineLength:DialogmotekandidatService.kt$DialogmotekandidatService$log.info("Mottok kandidatmelding med kandidatstatus ${dialogmotekandidatEndring.kandidat} og arsak ${dialogmotekandidatEndring.arsak}") + MaxLineLength:EsyfovarselKafkaConfig.kt$EsyfovarselKafkaConfig$fun + MaxLineLength:HistorikkService.kt$HistorikkService$. + MaxLineLength:IsOppfolgingstilfelleKafkaConfig.kt$KafkaIsOppfolgingstilfelleConfig$fun + MaxLineLength:IsOppfolgingstilfelleKafkaConfig.kt$KafkaIsOppfolgingstilfelleConfig$kafkaAivenConfig.commonKafkaAivenConfig() + kafkaAivenConfig.commonKafkaAivenConsumerConfig() + kafkaIsOppfolgingtilfelleConsumerConfig() + MaxLineLength:KafkaTestdataResetConfig.kt$KafkaTestdataResetConfig$kafkaAivenConfig.commonKafkaAivenConfig() + kafkaAivenConfig.commonKafkaAivenConsumerConfig() + kafkaTestdataResetConsumerConfig() + MaxLineLength:Metric.kt$Metric$val dayInOppfolgingstilfelleMotebehovCreated = ChronoUnit.DAYS.between(activeOppfolgingstilfelle.fom, LocalDate.now()) + MaxLineLength:Metric.kt$Metric$val navn = if (erInnloggetBrukerArbeidstaker) "syfomotebehov_motebehov_besvart_at" else "syfomotebehov_motebehov_besvart" + MaxLineLength:Metric.kt$Metric$val navn = if (erInnloggetBrukerArbeidstaker) "syfomotebehov_motebehov_besvart_ja_forklaring_at" else "syfomotebehov_motebehov_besvart_ja_forklaring_ag" + MaxLineLength:Metric.kt$Metric$val navn = if (erInnloggetBrukerArbeidstaker) "syfomotebehov_motebehov_besvart_ja_forklaring_lengde_at" else "syfomotebehov_motebehov_besvart_ja_forklaring_lengde_ag" + MaxLineLength:Metric.kt$Metric$val navn = if (erInnloggetBrukerArbeidstaker) "syfomotebehov_motebehov_besvart_nei_forklaring_lengde_at" else "syfomotebehov_motebehov_besvart_nei_forklaring_lengde" + MaxLineLength:Motebehov.kt$return createdDate.isAfter(firstDateSvarBehovAvailability.minusDays(1)) && createdDate.isBefore(lastDateSvarBehovAvailability.plusDays(1)) + MaxLineLength:Motebehov.kt$return createdDate.isAfter(oppfolgingstilfelle.fom.minusDays(1)) && createdDate.isBefore(oppfolgingstilfelle.tom.plusDays(17)) + MaxLineLength:MotebehovArbeidsgiverControllerV3.kt$MotebehovArbeidsgiverControllerV3$@ProtectedWithClaims(issuer = TokenXIssuer.TOKENX, claimMap = ["acr=Level4", "acr=idporten-loa-high"], combineWithOr = true) + MaxLineLength:MotebehovArbeidsgiverControllerV3Test.kt$MotebehovArbeidsgiverControllerV3Test$fun + MaxLineLength:MotebehovArbeidstakerControllerV3.kt$MotebehovArbeidstakerControllerV3$// This endpoint is only used by Ditt sykefravær. Should be removed when they stop calling it. Until then, return empty result + MaxLineLength:MotebehovArbeidstakerControllerV3.kt$MotebehovArbeidstakerControllerV3$@ProtectedWithClaims(issuer = TokenXIssuer.TOKENX, claimMap = ["acr=Level4", "acr=idporten-loa-high"], combineWithOr = true) + MaxLineLength:MotebehovArbeidstakerControllerV3Test.kt$MotebehovArbeidstakerControllerV3Test$fun + MaxLineLength:MotebehovArbeidstakerControllerV3Test.kt$MotebehovArbeidstakerControllerV3Test$val motebehovStatus: MotebehovStatus = motebehovArbeidstakerController.motebehovStatusArbeidstakerWithCodeSixUsers() + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$class + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$fun + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$return Optional.ofNullable(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? AND har_motebehov AND behandlet_veileder_ident IS NULL", innsendingRowMapper, aktoerId)).orElse(emptyList()) + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$return Optional.ofNullable(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? AND opprettet_av != ? AND virksomhetsnummer = ? AND opprettet_dato >= ? ORDER BY opprettet_dato DESC", innsendingRowMapper, arbeidstakerAktorId, arbeidstakerAktorId, virksomhetsnummer, hentTidligsteDatoForGyldigMotebehovSvar())).orElse(emptyList()) + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$return Optional.ofNullable(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? AND opprettet_av = ? AND opprettet_dato >= ? ORDER BY opprettet_dato DESC", innsendingRowMapper, arbeidstakerAktorId, arbeidstakerAktorId, hentTidligsteDatoForGyldigMotebehovSvar())).orElse(emptyList()) + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$return Optional.ofNullable(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? AND virksomhetsnummer = ? AND opprettet_dato >= ? ORDER BY opprettet_dato DESC", innsendingRowMapper, arbeidstakerAktorId, virksomhetsnummer, hentTidligsteDatoForGyldigMotebehovSvar())).orElse(emptyList()) + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$return Optional.ofNullable(jdbcTemplate.query("SELECT * FROM motebehov WHERE aktoer_id = ? ORDER BY opprettet_dato ASC", innsendingRowMapper, aktoerId)).orElse(emptyList()) + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$return Optional.ofNullable(jdbcTemplate.query("SELECT * FROM motebehov WHERE motebehov_uuid = ?", innsendingRowMapper, motebehovId)).orElse(emptyList()) + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$return Optional.ofNullable(jdbcTemplate.query("SELECT * FROM motebehov WHERE opprettet_dato < ? AND har_motebehov AND behandlet_veileder_ident IS NULL", innsendingRowMapper, convert(date))).orElse(emptyList()) + MaxLineLength:MotebehovDAO.kt$MotebehovDAO$val oppdaterSql = "UPDATE motebehov SET behandlet_tidspunkt = ?, behandlet_veileder_ident = ? WHERE motebehov_uuid = ? AND har_motebehov AND behandlet_veileder_ident IS NULL" + MaxLineLength:MotebehovDAOTest.kt$MotebehovDAOTest$"INSERT INTO MOTEBEHOV VALUES(DEFAULT, 'bae778f2-a085-11e8-98d0-529269fb1459', '" + motebehov.opprettetDato + "', '" + motebehov.opprettetAv + "', '" + motebehov.aktoerId + "', '" + motebehov.virksomhetsnummer + "', '" + '1' + "', '" + motebehov.forklaring + "', '" + motebehov.tildeltEnhet + "', null, null, null, null, null)" + MaxLineLength:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$throwCreateMotebehovConflict("Failed to create Motebehov for Arbeidsgiver: Found no Virksomhetsnummer with active Oppfolgingstilfelle available for answer") + MaxLineLength:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$throwCreateMotebehovConflict("Failed to create Motebehov for Arbeidstaker: Found no Virksomhetsnummer with active Oppfolgingstilfelle") + MaxLineLength:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$throwCreateMotebehovFailed("Failed to create Motebehov for Arbeidsgiver: Found no active Oppfolgingstilfelle for ${nyttMotebehov.virksomhetsnummer}") + MaxLineLength:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$throwCreateMotebehovFailed("Failed to create Motebehov for Arbeidstaker: Found no Virksomhetsnummer with active Oppfolgingstilfelle") + MaxLineLength:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$val activeOppfolgingstilfelle = oppfolgingstilfelleService.getActiveOppfolgingstilfelleForArbeidsgiver(arbeidstakerFnr, nyttMotebehov.virksomhetsnummer) + MaxLineLength:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$val activeOppolgingstilfelle = oppfolgingstilfelleService.getActiveOppfolgingstilfelleForArbeidstaker(arbeidstakerFnr) + MaxLineLength:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$val motebehovStatus = motebehovStatusServiceV2.motebehovStatusForArbeidsgiver(arbeidstakerFnr, isOwnLeader, nyttMotebehov.virksomhetsnummer) + MaxLineLength:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$varselServiceV2.ferdigstillSvarMotebehovVarselForNarmesteLeder(arbeidstakerFnr, innloggetFnr, nyttMotebehov.virksomhetsnummer) + MaxLineLength:MotebehovServiceTest.kt$MotebehovServiceTest$val count = motebehovService.behandleUbehandledeMotebehovOpprettetTidligereEnnDato(LocalDate.now().minusWeeks(1), veilederIdent) + MaxLineLength:MotebehovServiceTest.kt$MotebehovServiceTest$val count = motebehovService.behandleUbehandledeMotebehovOpprettetTidligereEnnDato(LocalDate.now().plusWeeks(1), veilederIdent) + MaxLineLength:MotebehovStatusServiceTest.kt$MotebehovStatusServiceTest$every { dialogmotekandidatService.getDialogmotekandidatStatus(userFnr) } returns createDialogmoteKandidatEndring() + MaxLineLength:MotebehovStatusServiceTest.kt$MotebehovStatusServiceTest$every { oppfolgingstilfelleService.getActiveOppfolgingstilfelleForArbeidstaker(userFnr) } returns createOppfolgingstilfelle() + MaxLineLength:MotebehovStatusServiceV2.kt$MotebehovStatusServiceV2$return motebehovStatusHelper.motebehovStatus(hasUpcomingDialogmote, oppfolgingstilfelle, isDialogmoteKandidat, motebehovList) + MaxLineLength:NarmesteLederService.kt$NarmesteLederService$// isnarmesteleder returnerer alle relasjoner, også der sykmeldte er leder for noen andre. Må derfor filtrere for å kun få lederne til den sykmeldte. + MaxLineLength:NullstillMotebehovController.kt$NullstillMotebehovController$log.info("Det ble gjort kall mot 'nullstill', men dette endepunktet er togglet av og skal aldri brukes i prod.") + MaxLineLength:NullstillMotebehovController.kt$NullstillMotebehovController$return + MaxLineLength:OppfolgingstilfelleService.kt$OppfolgingstilfelleService$expiredOppfolgingstilfelle.tom.isAfter(activeOppfolgingstilfelleList.minByOrNull { it.fom }!!.fom.minusDays(1)) + MaxLineLength:OppfolgingstilfelleService.kt$OppfolgingstilfelleService$return getActiveOppfolgingstilfelle(arbeidstakerFnr, getPOppfolgingstilfellerInActiveOppfolgingstilfelle(arbeidstakerFnr)) + MaxLineLength:OppfolgingstilfelleService.kt$OppfolgingstilfelleService$val + MaxLineLength:OppfolgingstilfelleService.kt$OppfolgingstilfelleService.Companion$private const val METRIC_RECEIVE_OPPFOLGINGSTILFELLE_CREATE = "${METRIC_RECEIVE_OPPFOLGINGSTILFELLE_BASE}_create" + MaxLineLength:OppfolgingstilfelleService.kt$OppfolgingstilfelleService.Companion$private const val METRIC_RECEIVE_OPPFOLGINGSTILFELLE_UPDATE = "${METRIC_RECEIVE_OPPFOLGINGSTILFELLE_BASE}_update" + MaxLineLength:OppfolgingstilfelleService.kt$OppfolgingstilfelleService.Companion$private const val METRIC_RECEIVE_OPPFOLGINGSTILFELLE_UPDATE_SKIP_DUPLICATE = "${METRIC_RECEIVE_OPPFOLGINGSTILFELLE_BASE}_update_skip_duplicate" + MaxLineLength:PersonoppgavehendelseKafkaConfig.kt$PersonoppgavehendelseKafkaConfig$fun + MaxLineLength:PersonoppgavehendelseProducer.kt$PersonoppgavehendelseProducer$@Qualifier("PersonoppgavehendelseTemplate") private val kafkaTemplate: KafkaTemplate<String, KPersonoppgavehendelse> + MaxLineLength:PersonoppgavehendelseProducer.kt$PersonoppgavehendelseProducer$log.info("Sending personoppgavehendelse of type ${kPersonoppgavehendelse.hendelsetype}, personoppgaveId: $personoppgaveId") + MaxLineLength:RestHelper.kt$. + MaxLineLength:TestdataResetServiceTest.kt$TestdataResetServiceTest$assertThat(dialogmoteDAO.getAktiveDialogmoterEtterDato(ARBEIDSTAKER_FNR, LocalDate.now().minusDays(1))).isEmpty() + MaxLineLength:TestdataResetServiceTest.kt$TestdataResetServiceTest$assertThat(dialogmoteDAO.getAktiveDialogmoterEtterDato(ARBEIDSTAKER_FNR, LocalDate.now().minusDays(1))).isNotEmpty() + MaxLineLength:TestdataResetServiceTest.kt$TestdataResetServiceTest$dialogmoteDAO.create(UUID.randomUUID().toString(), LocalDateTime.now(), LocalDateTime.now(), DialogmoteStatusEndringType.INNKALT.name, ARBEIDSTAKER_FNR, VIRKSOMHETSNUMMER) + MaxLineLength:TestdataResetServiceTest.kt$TestdataResetServiceTest$dialogmotekandidatDAO.create(UUID.randomUUID().toString(), LocalDateTime.now(), ARBEIDSTAKER_FNR, true, DialogmotekandidatEndringArsak.STOPPUNKT.name) + MaxLineLength:TestdataResetServiceTest.kt$TestdataResetServiceTest$motebehovDAO.create(PMotebehov(UUID.randomUUID(), LocalDateTime.now(), "meg", ARBEIDSTAKER_AKTORID, VIRKSOMHETSNUMMER, true)) + MaxLineLength:VarselServiceTest.kt$VarselServiceTest$every { oppfolgingstilfelleService.getActiveOppfolgingstilfelleForArbeidsgiver(userFnr, virksomhetsnummer2) } + MaxLineLength:VarselServiceTest.kt$VarselServiceTest$every { oppfolgingstilfelleService.getActiveOppfolgingstilfelleForArbeidsgiver(userFnr, virksomhetsnummer2) } returns null + MaxLineLength:VarselServiceTest.kt$VarselServiceTest$every { oppfolgingstilfelleService.getActiveOppfolgingstilfelleForArbeidstaker(any()) } returns createOppfolgingstilfelle() + MaxLineLength:VarselServiceV2.kt$VarselServiceV2$dialogmoteDAO.getAktiveDialogmoterEtterDato(ansattFnr, ansattesOppfolgingstilfelle?.fom ?: LocalDate.now()).isNotEmpty() + MaxLineLength:VarselServiceV2.kt$VarselServiceV2$ferdigstillSvarMotebehovVarselForNarmesteLeder(ansattFnr, it.narmesteLederPersonIdentNumber, it.virksomhetsnummer) + MaxLineLength:VarselServiceV2.kt$VarselServiceV2$log.info("Antall unike nærmeste ledere for kandidatUuid $kandidatUuid: ${narmesteLederRelations?.size ?: 0}, antall virksomheter: $amountOfVirksomheter") + MaxLineLength:VarselServiceV2.kt$VarselServiceV2$log.info("Not sending Varsel to Arbeidstaker because Møtebehov is not available for the combination of Arbeidstaker and Virksomhet") + MaxLineLength:VarselServiceV2.kt$VarselServiceV2$log.info("Not sending Varsel to Narmeste Leder because Møtebehov is not available for the combination of Arbeidstaker and Virksomhet") + MaximumLineLength:AzureAdV2TokenConsumer.kt$AzureAdV2TokenConsumer$ + MaximumLineLength:BehandleUbehandleteMotebehovScheduler.kt$BehandleUbehandleteMotebehovScheduler$ + MaximumLineLength:BehandlendeEnhetConsumer.kt$BehandlendeEnhetConsumer$ + MaximumLineLength:BrukertilgangConsumer.kt$BrukertilgangConsumer$ + MaximumLineLength:BrukertilgangService.kt$BrukertilgangService$ + MaximumLineLength:ControllerExceptionHandler.kt$ControllerExceptionHandler$ + MaximumLineLength:CredentialUtil.kt$ + MaximumLineLength:DbUtil.kt$DbUtil$ + MaximumLineLength:DialogmoteStatusendringListener.kt$DialogmoteStatusendringListener$ + MaximumLineLength:DialogmotekandidatKafkaConfig.kt$DialogmotekandidatKafkaConfig$ + MaximumLineLength:DialogmotekandidatService.kt$DialogmotekandidatService$ + MaximumLineLength:EsyfovarselKafkaConfig.kt$EsyfovarselKafkaConfig$ + MaximumLineLength:HistorikkService.kt$HistorikkService$ + MaximumLineLength:IsOppfolgingstilfelleKafkaConfig.kt$KafkaIsOppfolgingstilfelleConfig$ + MaximumLineLength:KafkaTestdataResetConfig.kt$KafkaTestdataResetConfig$ + MaximumLineLength:Metric.kt$Metric$ + MaximumLineLength:Motebehov.kt$ + MaximumLineLength:MotebehovArbeidsgiverControllerV3.kt$MotebehovArbeidsgiverControllerV3$@ + MaximumLineLength:MotebehovArbeidsgiverControllerV3Test.kt$MotebehovArbeidsgiverControllerV3Test$ + MaximumLineLength:MotebehovArbeidstakerControllerV3.kt$MotebehovArbeidstakerControllerV3$@ + MaximumLineLength:MotebehovArbeidstakerControllerV3Test.kt$MotebehovArbeidstakerControllerV3Test$ + MaximumLineLength:MotebehovDAO.kt$MotebehovDAO$ + MaximumLineLength:MotebehovDAO.kt$MotebehovDAO$class + MaximumLineLength:MotebehovDAOTest.kt$MotebehovDAOTest$ + MaximumLineLength:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$ + MaximumLineLength:MotebehovServiceTest.kt$MotebehovServiceTest$ + MaximumLineLength:MotebehovStatusServiceTest.kt$MotebehovStatusServiceTest$ + MaximumLineLength:MotebehovStatusServiceV2.kt$MotebehovStatusServiceV2$ + MaximumLineLength:NullstillMotebehovController.kt$NullstillMotebehovController$ + MaximumLineLength:OppfolgingstilfelleService.kt$OppfolgingstilfelleService$ + MaximumLineLength:OppfolgingstilfelleService.kt$OppfolgingstilfelleService.Companion$ + MaximumLineLength:PersonoppgavehendelseKafkaConfig.kt$PersonoppgavehendelseKafkaConfig$ + MaximumLineLength:PersonoppgavehendelseProducer.kt$PersonoppgavehendelseProducer$ + MaximumLineLength:RestHelper.kt$ + MaximumLineLength:TestdataResetServiceTest.kt$TestdataResetServiceTest$ + MaximumLineLength:VarselServiceTest.kt$VarselServiceTest$ + MaximumLineLength:VarselServiceV2.kt$VarselServiceV2$ + MayBeConst:DateUtil.kt$val ZONE_ID = "Europe/Oslo" + MemberNameEqualsClassName:DialogmoteStatusendringListener.kt$DialogmoteStatusendringListener$@KafkaListener(topics = [DIALOGMOTE_STATUSENDRING_TOPIC], containerFactory = "DialogmoteListenerContainerFactory") fun dialogmoteStatusEndringListener( consumerRecord: ConsumerRecord<String, KDialogmoteStatusEndring>, acknowledgment: Acknowledgment ) + MemberNameEqualsClassName:TestdataResetListener.kt$TestdataResetListener$@KafkaListener( topics = [TESTDATA_RESET_TOPIC], containerFactory = "TestdataResetListenerContainerFactory", ) fun testdataResetListener( consumerRecord: ConsumerRecord<String, String>, acknowledgment: Acknowledgment, ) + MultiLineIfElse:Metric.kt$Metric$"syfomotebehov_motebehov_besvart_oppfolgingstilfelle_dag_ag" + MultiLineIfElse:Metric.kt$Metric$null + MultiLineIfElse:MotebehovStatusServiceV2.kt$MotebehovStatusServiceV2$false + NestedBlockDepth:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$fun createMotebehovForArbeidgiver( innloggetFnr: String, arbeidstakerFnr: String, isOwnLeader: Boolean, nyttMotebehov: NyttMotebehovArbeidsgiver, ) + NestedBlockDepth:OppfolgingstilfelleService.kt$OppfolgingstilfelleService$fun receiveKOppfolgingstilfelle( kafkaOppfolgingstilfellePerson: KafkaOppfolgingstilfellePerson, ) + NoEmptyFirstLineInMethodBlock:DialogmotekandidatKafkaConfig.kt$DialogmotekandidatKafkaConfig$ + NoEmptyFirstLineInMethodBlock:EsyfovarselKafkaConfig.kt$EsyfovarselKafkaConfig$ + NoEmptyFirstLineInMethodBlock:IsOppfolgingstilfelleKafkaConfig.kt$KafkaIsOppfolgingstilfelleConfig$ + NoWildcardImports:ApplicationConfig.kt$import org.springframework.context.annotation.* + NoWildcardImports:AzureAdV2TokenConsumer.kt$import org.springframework.beans.factory.annotation.* + NoWildcardImports:AzureAdV2TokenConsumer.kt$import org.springframework.http.* + NoWildcardImports:BehandlendeEnhetConsumer.kt$import no.nav.syfo.util.* + NoWildcardImports:BehandlendeEnhetConsumer.kt$import org.springframework.http.* + NoWildcardImports:DateUtil.kt$import java.time.* + NoWildcardImports:DbUtil.kt$import java.time.* + NoWildcardImports:EsyfovarselService.kt$import no.nav.syfo.varsel.esyfovarsel.domain.* + NoWildcardImports:Motebehov.kt$import no.nav.syfo.motebehov.motebehovstatus.* + NoWildcardImports:MotebehovArbeidsgiverControllerV3.kt$import org.springframework.web.bind.annotation.* + NoWildcardImports:MotebehovArbeidstakerControllerV3.kt$import org.springframework.web.bind.annotation.* + NoWildcardImports:MotebehovGenerator.kt$import no.nav.syfo.motebehov.* + NoWildcardImports:MotebehovServiceTest.kt$import org.junit.jupiter.api.Assertions.* + NoWildcardImports:MotebehovStatusServiceV2.kt$import no.nav.syfo.motebehov.* + NoWildcardImports:MotebehovVeilederADControllerV3.kt$import org.springframework.web.bind.annotation.* + NoWildcardImports:MotebehovVeilederADControllerV3Test.kt$import org.assertj.core.api.Assertions.* + NoWildcardImports:MotebehovVeilederADControllerV3Test.kt$import org.junit.jupiter.api.Assertions.* + NoWildcardImports:MotebehovVeilederADTilgangV3Test.kt$import org.junit.jupiter.api.* + NoWildcardImports:MotebehovVeilederADTilgangV3Test.kt$import org.springframework.web.client.* + NoWildcardImports:MotebehovVeilederDTO.kt$import no.nav.syfo.motebehov.motebehovstatus.* + NoWildcardImports:NullstillMotebehovController.kt$import org.springframework.web.bind.annotation.* + NoWildcardImports:ObjectMapperConfig.kt$import com.fasterxml.jackson.databind.* + NoWildcardImports:OppfolgingstilfelleService.kt$import no.nav.syfo.oppfolgingstilfelle.database.* + NoWildcardImports:PdlConsumer.kt$import no.nav.syfo.util.* + NoWildcardImports:PdlConsumer.kt$import org.springframework.http.* + NoWildcardImports:PdlPersonResponseGenerator.kt$import no.nav.syfo.consumer.pdl.* + NoWildcardImports:PersonoppgavehendelseKafkaConfig.kt$import org.springframework.kafka.core.* + NoWildcardImports:SyfoTilgangskontrollMock.kt$import org.springframework.http.* + NoWildcardImports:VeilederTilgangConsumer.kt$import no.nav.syfo.util.* + NoWildcardImports:VeilederTilgangConsumer.kt$import org.springframework.http.* + NoWildcardImports:VeilederTilgangConsumer.kt$import org.springframework.web.client.* + ParameterListWrapping:EsyfovarselKafkaConfig.kt$EsyfovarselKafkaConfig$(@Qualifier("EsyfovarselProducerFactory") producerFactory: ProducerFactory<String, EsyfovarselHendelse>) + ParameterListWrapping:MotebehovDAO.kt$MotebehovDAO$(private val namedParameterJdbcTemplate: NamedParameterJdbcTemplate, private val jdbcTemplate: JdbcTemplate) + ParameterListWrapping:PersonoppgavehendelseKafkaConfig.kt$PersonoppgavehendelseKafkaConfig$(@Qualifier("PersonoppgavehendelseProducerFactory") producerFactory: ProducerFactory<String, KPersonoppgavehendelse>) + ParameterWrapping:PersonoppgavehendelseProducer.kt$PersonoppgavehendelseProducer$@Qualifier("PersonoppgavehendelseTemplate") private val kafkaTemplate: KafkaTemplate<String, KPersonoppgavehendelse> + PrintStackTrace:RestHelper.kt$e + ReturnCount:ControllerExceptionHandler.kt$ControllerExceptionHandler$@ExceptionHandler(Exception::class, IllegalArgumentException::class, ConstraintViolationException::class, ForbiddenException::class, JwtTokenUnauthorizedException::class) fun handleException(ex: Exception, request: WebRequest): ResponseEntity<ApiError> + ReturnCount:MotebehovStatusHelper.kt$MotebehovStatusHelper$fun isSvarBehovVarselAvailable( motebehovList: List<Motebehov>, oppfolgingstilfelle: PersonOppfolgingstilfelle?, ): Boolean + ReturnCount:MotebehovStatusHelper.kt$MotebehovStatusHelper$fun motebehovStatus( hasUpcomingDialogmote: Boolean, oppfolgingstilfelle: PersonOppfolgingstilfelle?, isDialogmoteKandidat: Boolean, motebehovList: List<Motebehov>, ): MotebehovStatus + SerialVersionUIDInSerializableClass:AzureAdV2Token.kt$AzureAdV2Token : Serializable + SerialVersionUIDInSerializableClass:AzureAdV2TokenResponse.kt$AzureAdV2TokenResponse : Serializable + SerialVersionUIDInSerializableClass:Motebehov.kt$Motebehov : Serializable + SerialVersionUIDInSerializableClass:MotebehovSkjemaType.kt$MotebehovSkjemaType : Serializable + SerialVersionUIDInSerializableClass:MotebehovStatus.kt$MotebehovStatus : Serializable + SerialVersionUIDInSerializableClass:MotebehovSvar.kt$MotebehovSvar : Serializable + SerialVersionUIDInSerializableClass:MotebehovSvarVeilederDTO.kt$MotebehovSvarVeilederDTO : Serializable + SerialVersionUIDInSerializableClass:MotebehovTilbakemelding.kt$MotebehovTilbakemelding : Serializable + SerialVersionUIDInSerializableClass:MotebehovVeilederDTO.kt$MotebehovVeilederDTO : Serializable + SerialVersionUIDInSerializableClass:NyttMotebehov.kt$NyttMotebehov : Serializable + SerialVersionUIDInSerializableClass:NyttMotebehovArbeidsgiver.kt$NyttMotebehovArbeidsgiver : Serializable + SerialVersionUIDInSerializableClass:PMotebehov.kt$PMotebehov : Serializable + SerialVersionUIDInSerializableClass:PdlPersonResponse.kt$Adressebeskyttelse : Serializable + SerialVersionUIDInSerializableClass:PdlPersonResponse.kt$Gradering : Serializable + SerialVersionUIDInSerializableClass:PdlPersonResponse.kt$PdlHentPerson : Serializable + SerialVersionUIDInSerializableClass:PdlPersonResponse.kt$PdlPerson : Serializable + SerialVersionUIDInSerializableClass:PdlPersonResponse.kt$PdlPersonNavn : Serializable + SerialVersionUIDInSerializableClass:TokenXResponse.kt$TokenXResponse : Serializable + SerialVersionUIDInSerializableClass:TokenXToken.kt$TokenXToken : Serializable + SpreadOperator:Application.kt$(*args) + SwallowedException:BrukertilgangService.kt$BrukertilgangService$e: ForbiddenException + SwallowedException:DialogmotekandidatDAO.kt$DialogmotekandidatDAO$emptyException: EmptyResultDataAccessException + SwallowedException:IsOppfolgingstilfelleKafkaConfig.kt$KafkaIsOppfolgingstilfelleDeserializer$e: Exception + SwallowedException:KafkaDialogmotekandidatDeserializer.kt$KafkaDialogmotekandidatDeserializer$e: Exception + SwallowedException:OppfolgingstilfelleDAO.kt$OppfolgingstilfelleDAO$emptyException: EmptyResultDataAccessException + SwallowedException:PdlConsumer.kt$PdlConsumer$e: NoSuchElementException + ThrowsCount:LeaderElectionClient.kt$LeaderElectionClient$fun isLeader(): Boolean + ThrowsCount:PdlConsumer.kt$PdlConsumer$fun aktorid(fnr: String): String + ThrowsCount:PdlConsumer.kt$PdlConsumer$fun fnr(aktorid: String): String + TooGenericExceptionCaught:DialogmoteStatusendringListener.kt$DialogmoteStatusendringListener$e: Exception + TooGenericExceptionCaught:DialogmotekandidatListener.kt$DialogmotekandidatListener$e: Exception + TooGenericExceptionCaught:EsyfovarselProducer.kt$EsyfovarselProducer$e: Exception + TooGenericExceptionCaught:IsOppfolgingstilfelleKafkaConfig.kt$KafkaIsOppfolgingstilfelleDeserializer$e: Exception + TooGenericExceptionCaught:IsOppfolgingstilfelleListener.kt$IsOppfolgingstilfelleListener$e: Exception + TooGenericExceptionCaught:KafkaDialogmotekandidatDeserializer.kt$KafkaDialogmotekandidatDeserializer$e: Exception + TooGenericExceptionCaught:LeaderElectionClient.kt$LeaderElectionClient$e: Exception + TooGenericExceptionCaught:NarmesteLederClient.kt$NarmesteLederClient$e: Exception + TooGenericExceptionCaught:PersonoppgavehendelseProducer.kt$PersonoppgavehendelseProducer$e: Exception + TooGenericExceptionCaught:TestdataResetListener.kt$TestdataResetListener$e: Exception + TooGenericExceptionThrown:LeaderElectionClient.kt$LeaderElectionClient$throw RuntimeException("Call to elector returned null") + TooGenericExceptionThrown:LeaderElectionClient.kt$LeaderElectionClient$throw RuntimeException("Couldn't map response from electorpath to LeaderPod object", e) + TooGenericExceptionThrown:LeaderElectionClient.kt$LeaderElectionClient$throw RuntimeException("Got exception when trying to find leader", e) + TooGenericExceptionThrown:LocalApplicationConfig.kt$LocalApplicationConfig$throw RuntimeException(jsonProcessingException) + TooGenericExceptionThrown:MotebehovOppfolgingstilfelleServiceV2.kt$MotebehovOppfolgingstilfelleServiceV2$throw RuntimeException(errorMessage) + TooGenericExceptionThrown:PdlConsumer.kt$PdlConsumer$throw RuntimeException("Error while requesting AKTORID from PDL") + TooGenericExceptionThrown:PdlConsumer.kt$PdlConsumer$throw RuntimeException("Error while requesting FNR from PDL") + TooGenericExceptionThrown:SyfoTilgangskontrollMock.kt$throw RuntimeException(e) + TooManyFunctions:Metric.kt$Metric + UnusedPrivateProperty:MotebehovGenerator.kt$MotebehovGenerator$private val nyttMotebehovArbeidstaker = NyttMotebehov( arbeidstakerFnr = ARBEIDSTAKER_FNR, virksomhetsnummer = VIRKSOMHETSNUMMER, motebehovSvar = motebehovSvar, tildeltEnhet = NAV_ENHET, ) + UnusedPrivateProperty:MotebehovServiceTest.kt$MotebehovServiceTest$@MockkBean(relaxed = true) private lateinit var personoppgavehendelseService: PersonoppgavehendelseService + VariableNaming:ControllerExceptionHandler.kt$ControllerExceptionHandler$private val BAD_REQUEST_MSG = "Vi kunne ikke tolke inndataene" + VariableNaming:ControllerExceptionHandler.kt$ControllerExceptionHandler$private val CONFLICT_MSG = "Dette oppsto en konflikt i tilstand" + VariableNaming:ControllerExceptionHandler.kt$ControllerExceptionHandler$private val FORBIDDEN_MSG = "Handling er forbudt" + VariableNaming:ControllerExceptionHandler.kt$ControllerExceptionHandler$private val INTERNAL_MSG = "Det skjedde en uventet feil" + VariableNaming:ControllerExceptionHandler.kt$ControllerExceptionHandler$private val UNAUTHORIZED_MSG = "Autorisasjonsfeil" + WildcardImport:ApplicationConfig.kt$import org.springframework.context.annotation.* + WildcardImport:AzureAdV2TokenConsumer.kt$import org.springframework.beans.factory.annotation.* + WildcardImport:AzureAdV2TokenConsumer.kt$import org.springframework.http.* + WildcardImport:BehandlendeEnhetConsumer.kt$import no.nav.syfo.util.* + WildcardImport:BehandlendeEnhetConsumer.kt$import org.springframework.http.* + WildcardImport:DateUtil.kt$import java.time.* + WildcardImport:DbUtil.kt$import java.time.* + WildcardImport:EsyfovarselService.kt$import no.nav.syfo.varsel.esyfovarsel.domain.* + WildcardImport:Motebehov.kt$import no.nav.syfo.motebehov.motebehovstatus.* + WildcardImport:MotebehovArbeidsgiverControllerV3.kt$import org.springframework.web.bind.annotation.* + WildcardImport:MotebehovArbeidstakerControllerV3.kt$import org.springframework.web.bind.annotation.* + WildcardImport:MotebehovGenerator.kt$import no.nav.syfo.motebehov.* + WildcardImport:MotebehovServiceTest.kt$import org.junit.jupiter.api.Assertions.* + WildcardImport:MotebehovStatusServiceV2.kt$import no.nav.syfo.motebehov.* + WildcardImport:MotebehovVeilederADControllerV3.kt$import org.springframework.web.bind.annotation.* + WildcardImport:MotebehovVeilederADControllerV3Test.kt$import org.assertj.core.api.Assertions.* + WildcardImport:MotebehovVeilederADControllerV3Test.kt$import org.junit.jupiter.api.Assertions.* + WildcardImport:MotebehovVeilederADTilgangV3Test.kt$import org.junit.jupiter.api.* + WildcardImport:MotebehovVeilederADTilgangV3Test.kt$import org.springframework.web.client.* + WildcardImport:MotebehovVeilederDTO.kt$import no.nav.syfo.motebehov.motebehovstatus.* + WildcardImport:NullstillMotebehovController.kt$import org.springframework.web.bind.annotation.* + WildcardImport:ObjectMapperConfig.kt$import com.fasterxml.jackson.databind.* + WildcardImport:OppfolgingstilfelleService.kt$import no.nav.syfo.oppfolgingstilfelle.database.* + WildcardImport:PdlConsumer.kt$import no.nav.syfo.util.* + WildcardImport:PdlConsumer.kt$import org.springframework.http.* + WildcardImport:PdlPersonResponseGenerator.kt$import no.nav.syfo.consumer.pdl.* + WildcardImport:PersonoppgavehendelseKafkaConfig.kt$import org.springframework.kafka.core.* + WildcardImport:SyfoTilgangskontrollMock.kt$import org.springframework.http.* + WildcardImport:VeilederTilgangConsumer.kt$import no.nav.syfo.util.* + WildcardImport:VeilederTilgangConsumer.kt$import org.springframework.http.* + WildcardImport:VeilederTilgangConsumer.kt$import org.springframework.web.client.* + Wrapping:MotebehovStatusServiceTest.kt$MotebehovStatusServiceTest$oppfolgingstilfelleService.getActiveOppfolgingstilfelleForArbeidstaker(userFnr) + Wrapping:VarselServiceTest.kt$VarselServiceTest$oppfolgingstilfelleService.getActiveOppfolgingstilfelleForArbeidsgiver(userFnr, virksomhetsnummer2) + Wrapping:VarselServiceTest.kt$VarselServiceTest$oppfolgingstilfelleService.getActiveOppfolgingstilfelleForArbeidstaker(any()) + + diff --git a/detekt-config.yml b/detekt-config.yml new file mode 100644 index 00000000..ecaa2b4b --- /dev/null +++ b/detekt-config.yml @@ -0,0 +1,6 @@ +style: + MagicNumber: + active: false +config: + validation: true + warningsAsErrors: true \ No newline at end of file