-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix long numbers problem #98
Conversation
5b9a56d
to
8331b94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scalastyle (reported by Codacy) found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
case bd if bd.isValidLong => ofLong(bd.toLongExact) | ||
case db if db.isDecimalFloat => ofFloat(db.floatValue) | ||
case db if db.isDecimalDouble => ofDouble(db.doubleValue) | ||
case bd => ofBigDecimal(bd) | ||
case bd => |
Check notice
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Prohibit case statement pattern match from being lowercase.
case db if db.isValidByte => ofLong(db.toByteExact.toLong) | ||
case db if db.isValidShort => ofLong(db.toShortExact.toLong) | ||
case db if db.isValidInt => ofLong(db.toIntExact.toLong) | ||
case db if db.isValidByte => ofByte(db.toByteExact) |
Check notice
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Prohibits same expression on cases inside the same scope
testFromDataString[BigDecimal] | ||
testFromDataString[VeryLongNumericString] | ||
|
||
private def testFromNumberString[T: Arbitrary](shouldFail: Boolean = false)(implicit |
Check notice
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Values should have minimum scope to avoid misuses.
property(s"Xml.fromNumberString works with ${c.runtimeClass.getSimpleName}") { | ||
forAll { (value: T) => | ||
assertEquals( | ||
Xml.fromNumberString(value.toString).get.toBigDecimal, |
Check notice
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Calling get should be avoided on Option and Either.
number.toBigDecimal, | ||
Some(BigDecimal(value.toString)) | ||
) | ||
case other => |
Check notice
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Prohibit case statement pattern match from being lowercase.
} | ||
} | ||
|
||
private def testFromDataString[T: Arbitrary](implicit |
Check notice
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Values should have minimum scope to avoid misuses.
No description provided.