Skip to content

Commit

Permalink
fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bobeal committed Jan 3, 2025
1 parent 2e7ff74 commit 9fdb2cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ class TemporalQueryService(
// - timeAt if it is provided
// - the oldest value if not (timeAt is optional if querying a temporal entity by id)

if (!temporalEntitiesQuery.withAggregatedValues)
return null
return if (!temporalEntitiesQuery.withAggregatedValues)
null
else if (temporalQuery.timeAt != null)
return temporalQuery.timeAt
temporalQuery.timeAt
else {
val originForAttributes =
attributeInstanceService.selectOldestDate(temporalQuery, attributes)
Expand All @@ -108,7 +108,7 @@ class TemporalQueryService(
scopeService.selectOldestDate(entityId, temporalEntitiesQuery.temporalQuery.timeproperty)
else null

return when {
when {
originForAttributes == null -> originForScope
originForScope == null -> originForAttributes
else -> minOf(originForAttributes, originForScope)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fun String.checkNameIsNgsiLdSupported(): Either<APIException, Unit> =
private fun String.isNgsiLdSupportedName(): Boolean =
this.all { char -> char.isLetterOrDigit() || listOf(':', '_', '@').contains(char) }

val scopeNameRegex: Regex = """^/?\p{L}+[\p{L}\w_]*(/\p{L}+[\p{L}\w_]*)*$""".toRegex()
val scopeNameRegex: Regex = """^/?\p{L}+[\p{L}\w]*(/\p{L}+[\p{L}\w]*)*$""".toRegex()

fun Any.checkScopesNamesAreNgsiLdSupported(): Either<APIException, Unit> {
val rawScope = this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ object JsonLdUtils {
if (NGSILD_GEO_PROPERTIES_TERMS.contains(it.key)) {
when (it.value) {
is Map<*, *> -> {
val geoProperty = it.value as MutableMap<String, Any>
val geoProperty = it.value as Map<String, Any>
val wktGeometry = geoPropertyToWKTOrNull(geoProperty[JSONLD_VALUE_TERM]!!)
geoProperty.plus(JSONLD_VALUE_TERM to wktGeometry)
}
Expand Down

0 comments on commit 9fdb2cc

Please sign in to comment.