Scapegoat Inspections
Errors
0
Warnings
40
Infos
27
.home.travis.build.ZGIS.smart-csw-ingester.app.controllers.MainController.scala:62
Warning
Unused method parameter
com.sksamuel.scapegoat.inspections.unneccesary.UnusedMethodParameter
Unused method parameter (val fields: Option[String] = _)
.home.travis.build.ZGIS.smart-csw-ingester.app.controllers.QueryController.scala:110
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
fromDateStr.get
.home.travis.build.ZGIS.smart-csw-ingester.app.controllers.QueryController.scala:115
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
toDateStr.get
.home.travis.build.ZGIS.smart-csw-ingester.app.controllers.QueryController.scala:148
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
query.get
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.CIOnlineResource.scala:157
Warning
Unused method parameter
com.sksamuel.scapegoat.inspections.unneccesary.UnusedMethodParameter
Unused method parameter (val origin: String = _)
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:667
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near MdMetadataSet.this.wktReader.read(envelope).asInstanceOf[org.locationtech.spatial4j.shape.Rectangle]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:231
Warning
Catch exception
com.sksamuel.scapegoat.inspections.exception.CatchException
Did you intend to catch all exceptions, consider catching a more specific exception class: try {
nodeSeq.head.label match {
case "MD_Metadata" => {
val identificationInfo: String = "_";
scala.Some.apply[models.gmd.MdMetadataSet]({
<artifact> val x$7: String = nodeSeq.\("fileIdentifier").\("CharacterString").text;
<artifact> val x$8: java.time.LocalDate =
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:329
Info
List.size is O(n)
com.sksamuel.scapegoat.inspections.collections.ListSize
List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or Array.
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:330
Info
List.size is O(n)
com.sksamuel.scapegoat.inspections.collections.ListSize
List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or Array.
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:778
Info
List.size is O(n)
com.sksamuel.scapegoat.inspections.collections.ListSize
List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or Array.
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:787
Info
List.size is O(n)
com.sksamuel.scapegoat.inspections.collections.ListSize
List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or Array.
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:838
Info
List.size is O(n)
com.sksamuel.scapegoat.inspections.collections.ListSize
List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or Array.
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:322
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
x$3.get
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:752
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
json.this.JsValue.jsValueToJsLookup(bbox).apply(0).asOpt[Double](json.this.Reads.DoubleReads).get
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:753
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
json.this.JsValue.jsValueToJsLookup(bbox).apply(0).asOpt[Double](json.this.Reads.DoubleReads).get
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:753
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
json.this.JsValue.jsValueToJsLookup(bbox).apply(2).asOpt[Double](json.this.Reads.DoubleReads).get
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:754
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
json.this.JsValue.jsValueToJsLookup(bbox).apply(2).asOpt[Double](json.this.Reads.DoubleReads).get
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:757
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
json.this.JsValue.jsValueToJsLookup(bbox).apply(2).asOpt[Double](json.this.Reads.DoubleReads).get
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:569
Info
Match instead of partial function
com.sksamuel.scapegoat.inspections.matching.PartialFunctionInsteadOfMatch
A map match can be replaced with a partial function for greater readability: immutable.this.List.apply[Double](west, east).map[Double, List[Double]](((value: Double) => value match {
case (n @ _) if value.>=(MdMetadataSet.this.minLon).&&(value.<=(MdMetadataSet.this.maxLon)) => n
case (n @ _) if scala.math.`package`.abs(value.%(scala.math.`package`.abs(MdMetadataSet.this.minLon.-(MdMetadataSet.this.maxLon)))).<(MdMetadataSet.this.maxLon) => {
val result: Double = value.%(MdMetadataSet.this.maxLon);
MdMetadataSet.this.logger.info(({
val arg$macro$35: Any
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:232
Warning
Use of Traversable.head
com.sksamuel.scapegoat.inspections.collections.TraversableHead
nodeSeq.head
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:257
Warning
Use of Traversable.head
com.sksamuel.scapegoat.inspections.collections.TraversableHead
nodeSeq.head
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.MdMetadataSet.scala:332
Warning
Use of Traversable.head
com.sksamuel.scapegoat.inspections.collections.TraversableHead
datesList.head
.home.travis.build.ZGIS.smart-csw-ingester.app.models.gmd.SVServiceIdentification.scala:50
Warning
Unused method parameter
com.sksamuel.scapegoat.inspections.unneccesary.UnusedMethodParameter
Unused method parameter (val nodeSeq: scala.xml.NodeSeq = _)
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneIndexBuilderActor.scala:170
Info
filter(_.isDefined).map(_.get)
com.sksamuel.scapegoat.inspections.collections.FilterOptionAndGet
.filter(_.isDefined).map(_.get) can be replaced with flatten: cswGetRecordsResponse.xml.\\("MD_Metadata").map[Option[models.gmd.MdMetadataSet], scala.collection.immutable.Seq[Option[models.gmd.MdMetadataSet]]](((mdMetadataNode: scala.xml.Node) => {
LuceneIndexBuilderActor.this.logger.debug(({
val arg$macro$43: Any = catalogueName;
val arg$macro$44: Any = mdMetadataNode.\("fileIdentifier").\("CharacterString").text;
new scala.collection.immutable.StringOps("Preparing(%s): %s").format(arg$macro$43, arg$macro$44)
}: String));
LuceneIndexBuil
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneIndexBuilderActor.scala:170
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
item.get
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneIndexBuilderActor.scala:226
Warning
Unnecessary toString
com.sksamuel.scapegoat.inspections.unneccesary.UnnecessaryToString
Unnecessary toString on instanceo of String: wsClientResponse.body.toString
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:205
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near avro4s.this.FromValue.StringFromValue.asInstanceOf[com.sksamuel.avro4s.FromValue.StringFromValue.type]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:205
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near avro4s.this.FromValue.SeqFromValue[String](avro4s.this.FromValue.StringFromValue).asInstanceOf[com.sksamuel.avro4s.FromValue[Seq[String]]]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:205
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near $anon.this.converters.apply(0).asInstanceOf[shapeless.Lazy[com.sksamuel.avro4s.FromValue[String]]]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:205
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near $anon.this.converters.apply(1).asInstanceOf[shapeless.Lazy[com.sksamuel.avro4s.FromValue[Seq[String]]]]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near avro4s.this.ToValue.StringToValue.asInstanceOf[com.sksamuel.avro4s.ToValue.StringToValue.type]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near avro4s.this.ToValue.SeqToValue[String](avro4s.this.ToValue.StringToValue).asInstanceOf[com.sksamuel.avro4s.ToValue[Seq[String]]]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near $anon.this.converters.apply(0).asInstanceOf[shapeless.Lazy[com.sksamuel.avro4s.ToValue[String]]]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near $anon.this.converters.apply(1).asInstanceOf[shapeless.Lazy[com.sksamuel.avro4s.ToValue[Seq[String]]]]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:132
Warning
Null parameter
com.sksamuel.scapegoat.inspections.nulls.NullParameter
Null is used as a method parameter: new org.apache.lucene.search.SearcherManager(LuceneService.this.indexDirectory, null)
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:115
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
LuceneService.this.configuration.getConfigList("csw.catalogues").get
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:116
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
item.getString("name", item.getString$default$2).get
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:116
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
item.getString("url", item.getString$default$2).get
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:329
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
maxNumberOfResults.get
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:128
Info
Prefer Seq.empty
com.sksamuel.scapegoat.inspections.collections.PreferSeqEmpty
Seq[T]() creates a new instance. Consider Seq.empty which does not allocate a new object. collection.this.Seq.apply[Nothing]()
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:128
Info
Prefer Seq.empty
com.sksamuel.scapegoat.inspections.collections.PreferSeqEmpty
Seq[T]() creates a new instance. Consider Seq.empty which does not allocate a new object. collection.this.Seq.apply[Nothing]()
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:128
Info
Prefer Seq.empty
com.sksamuel.scapegoat.inspections.collections.PreferSeqEmpty
Seq[T]() creates a new instance. Consider Seq.empty which does not allocate a new object. collection.this.Seq.apply[Nothing]()
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Info
Prefer Seq.empty
com.sksamuel.scapegoat.inspections.collections.PreferSeqEmpty
Seq[T]() creates a new instance. Consider Seq.empty which does not allocate a new object. collection.this.Seq.apply[Nothing]()
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Info
Prefer Seq.empty
com.sksamuel.scapegoat.inspections.collections.PreferSeqEmpty
Seq[T]() creates a new instance. Consider Seq.empty which does not allocate a new object. collection.this.Seq.apply[Nothing]()
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Info
Prefer Seq.empty
com.sksamuel.scapegoat.inspections.collections.PreferSeqEmpty
Seq[T]() creates a new instance. Consider Seq.empty which does not allocate a new object. collection.this.Seq.apply[Nothing]()
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Info
Prefer Seq.empty
com.sksamuel.scapegoat.inspections.collections.PreferSeqEmpty
Seq[T]() creates a new instance. Consider Seq.empty which does not allocate a new object. collection.this.Seq.apply[Nothing]()
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Info
Prefer Seq.empty
com.sksamuel.scapegoat.inspections.collections.PreferSeqEmpty
Seq[T]() creates a new instance. Consider Seq.empty which does not allocate a new object. collection.this.Seq.apply[Nothing]()
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:249
Info
Prefer Seq.empty
com.sksamuel.scapegoat.inspections.collections.PreferSeqEmpty
Seq[T]() creates a new instance. Consider Seq.empty which does not allocate a new object. collection.this.Seq.apply[Nothing]()
.home.travis.build.ZGIS.smart-csw-ingester.app.services.LuceneService.scala:105
Warning
Unused constructor parameter
com.sksamuel.scapegoat.inspections.unneccesary.UnusedMethodParameter
Unused constructor parameter (wsClient)
.home.travis.build.ZGIS.smart-csw-ingester.app.utils.OwcGeoJsonConverters.scala:232
Info
filter(_.isDefined).map(_.get)
com.sksamuel.scapegoat.inspections.collections.FilterOptionAndGet
.filter(_.isDefined).map(_.get) can be replaced with flatten: mdMetadataSet.linkage.map[Option[info.smart.models.owc100.OwcLink], List[Option[info.smart.models.owc100.OwcLink]]](((x$2: models.gmd.CIOnlineResource) => OwcGeoJsonConverters.this.asOwcLink(x$2)))(immutable.this.List.canBuildFrom[Option[info.smart.models.owc100.OwcLink]]).filter(((x$3: Option[info.smart.models.owc100.OwcLink]) => x$3.isDefined)).map[info.smart.models.owc100.OwcLink, List[info.smart.models.owc100.OwcLink]](((x$4: Option[info.smart.models.owc100.OwcLink]) => x$4.get))
.home.travis.build.ZGIS.smart-csw-ingester.app.utils.OwcGeoJsonConverters.scala:236
Info
filter(_.isDefined).map(_.get)
com.sksamuel.scapegoat.inspections.collections.FilterOptionAndGet
.filter(_.isDefined).map(_.get) can be replaced with flatten: mdMetadataSet.linkage.map[Option[info.smart.models.owc100.OwcLink], List[Option[info.smart.models.owc100.OwcLink]]](((x$5: models.gmd.CIOnlineResource) => OwcGeoJsonConverters.this.asOwcLink(x$5)))(immutable.this.List.canBuildFrom[Option[info.smart.models.owc100.OwcLink]]).filter(((x$6: Option[info.smart.models.owc100.OwcLink]) => x$6.isDefined)).map[info.smart.models.owc100.OwcLink, List[info.smart.models.owc100.OwcLink]](((x$7: Option[info.smart.models.owc100.OwcLink]) => x$7.get))
.home.travis.build.ZGIS.smart-csw-ingester.app.utils.OwcGeoJsonConverters.scala:240
Info
filter(_.isDefined).map(_.get)
com.sksamuel.scapegoat.inspections.collections.FilterOptionAndGet
.filter(_.isDefined).map(_.get) can be replaced with flatten: mdMetadataSet.linkage.map[Option[info.smart.models.owc100.OwcLink], List[Option[info.smart.models.owc100.OwcLink]]](((x$8: models.gmd.CIOnlineResource) => OwcGeoJsonConverters.this.asOwcLink(x$8)))(immutable.this.List.canBuildFrom[Option[info.smart.models.owc100.OwcLink]]).filter(((x$9: Option[info.smart.models.owc100.OwcLink]) => x$9.isDefined)).map[info.smart.models.owc100.OwcLink, List[info.smart.models.owc100.OwcLink]](((x$10: Option[info.smart.models.owc100.OwcLink]) => x$10.get))
.home.travis.build.ZGIS.smart-csw-ingester.app.utils.OwcGeoJsonConverters.scala:244
Info
filter(_.isDefined).map(_.get)
com.sksamuel.scapegoat.inspections.collections.FilterOptionAndGet
.filter(_.isDefined).map(_.get) can be replaced with flatten: mdMetadataSet.linkage.map[Option[info.smart.models.owc100.OwcLink], List[Option[info.smart.models.owc100.OwcLink]]](((x$11: models.gmd.CIOnlineResource) => OwcGeoJsonConverters.this.asOwcLink(x$11)))(immutable.this.List.canBuildFrom[Option[info.smart.models.owc100.OwcLink]]).filter(((x$12: Option[info.smart.models.owc100.OwcLink]) => x$12.isDefined)).map[info.smart.models.owc100.OwcLink, List[info.smart.models.owc100.OwcLink]](((x$13: Option[info.smart.models.owc100.OwcLink]) => x$13.get))
.home.travis.build.ZGIS.smart-csw-ingester.app.utils.OwcGeoJsonConverters.scala:232
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
x$4.get
.home.travis.build.ZGIS.smart-csw-ingester.app.utils.OwcGeoJsonConverters.scala:236
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
x$7.get
.home.travis.build.ZGIS.smart-csw-ingester.app.utils.OwcGeoJsonConverters.scala:240
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
x$10.get
.home.travis.build.ZGIS.smart-csw-ingester.app.utils.OwcGeoJsonConverters.scala:244
Warning
Use of Option.get
com.sksamuel.scapegoat.inspections.option.OptionGet
x$13.get
.home.travis.build.ZGIS.smart-csw-ingester.app.utils.OwcGeoJsonConverters.scala:271
Warning
Use of Traversable.head
com.sksamuel.scapegoat.inspections.collections.TraversableHead
dateRange.head
.home.travis.build.ZGIS.smart-csw-ingester.target.scala-2.11.routes.main.controllers.ReverseRoutes.scala:17
Info
Method name not recommended
com.sksamuel.scapegoat.inspections.naming.MethodNames
Methods should be in camelCase style with the first letter lower-case. See http://docs.scala-lang.org/style/naming-conventions.html#methods
.home.travis.build.ZGIS.smart-csw-ingester.target.scala-2.11.routes.main.controllers.ReverseRoutes.scala:44
Info
Method name not recommended
com.sksamuel.scapegoat.inspections.naming.MethodNames
Methods should be in camelCase style with the first letter lower-case. See http://docs.scala-lang.org/style/naming-conventions.html#methods
.home.travis.build.ZGIS.smart-csw-ingester.target.scala-2.11.routes.main.controllers.ReverseRoutes.scala:71
Info
Method name not recommended
com.sksamuel.scapegoat.inspections.naming.MethodNames
Methods should be in camelCase style with the first letter lower-case. See http://docs.scala-lang.org/style/naming-conventions.html#methods
.home.travis.build.ZGIS.smart-csw-ingester.target.scala-2.11.routes.main.controllers.javascript.JavaScriptReverseRoutes.scala:20
Info
Method name not recommended
com.sksamuel.scapegoat.inspections.naming.MethodNames
Methods should be in camelCase style with the first letter lower-case. See http://docs.scala-lang.org/style/naming-conventions.html#methods
.home.travis.build.ZGIS.smart-csw-ingester.target.scala-2.11.routes.main.controllers.javascript.JavaScriptReverseRoutes.scala:60
Info
Method name not recommended
com.sksamuel.scapegoat.inspections.naming.MethodNames
Methods should be in camelCase style with the first letter lower-case. See http://docs.scala-lang.org/style/naming-conventions.html#methods
.home.travis.build.ZGIS.smart-csw-ingester.target.scala-2.11.routes.main.controllers.javascript.JavaScriptReverseRoutes.scala:100
Info
Method name not recommended
com.sksamuel.scapegoat.inspections.naming.MethodNames
Methods should be in camelCase style with the first letter lower-case. See http://docs.scala-lang.org/style/naming-conventions.html#methods
.home.travis.build.ZGIS.smart-csw-ingester.target.scala-2.11.routes.main.router.Routes.scala:58
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near r.asInstanceOf[(String, String, String)]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.target.scala-2.11.routes.main.router.Routes.scala:59
Warning
Use of asInstanceOf
com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
asInstanceOf used near l.asInstanceOf[List[(String, String, String)]]. Consider using pattern matching.
.home.travis.build.ZGIS.smart-csw-ingester.target.scala-2.11.routes.main.router.Routes.scala:58
Info
List append is slow
com.sksamuel.scapegoat.inspections.collections.ListAppend
List append is O(n). For large lists, consider using cons (::) or another data structure such as ListBuffer or Vector and converting to a List once built.