Skip to content

Commit

Permalink
FSR-1159 | sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash committed Mar 21, 2024
1 parent 2c1f209 commit 15dc33c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/models/rloi.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function removePostfix (name) {
}

async function fetchStation (s3, bucket, key) {
return await s3.getObject({
return s3.getObject({
Bucket: bucket,
Key: key
})
Expand Down Expand Up @@ -57,6 +57,8 @@ function setValueItem (index, res, setOfValues) {
module.exports = {
async save (value, bucket, key, client, s3) {
let processed = 0
const concurrence = 3
const processedValueDecimalPlace = 3

const valuesCount = getValuesCount(value.EATimeSeriesDataExchangeFormat.Station)

Expand All @@ -73,7 +75,7 @@ module.exports = {
item.$.telemetryRegion = item.$.region
item.$.region = regions[item.$.region] ? regions[item.$.region] : item.$.region

await directly(3, item.SetofValues.map(setOfValues => async () => {
await directly(concurrence, item.SetofValues.map(setOfValues => async () => {
let station

try {
Expand Down Expand Up @@ -134,7 +136,7 @@ module.exports = {
if (setOfValues.$.parameter === 'Water Level') {
// Subtract value if post process required
if (station.Post_Process.toLowerCase() === 'y' || station.Post_Process.toLowerCase() === 'yes') {
values[i].processed_value = station.Subtract ? parseFloat(util.toFixed(values[i].value - parseFloat(station.Subtract), 3)) : values[i].value
values[i].processed_value = station.Subtract ? parseFloat(util.toFixed(values[i].value - parseFloat(station.Subtract), processedValueDecimalPlace)) : values[i].value
}
if (!util.isNumeric(values[i].processed_value)) {
values[i].processed_value = null
Expand Down

0 comments on commit 15dc33c

Please sign in to comment.