mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-03-22 09:10:00 +01:00
Initial commit
This commit is contained in:
37
app/controllers/package.scala
Normal file
37
app/controllers/package.scala
Normal file
@@ -0,0 +1,37 @@
|
||||
import com.mohiva.play.silhouette.api.Environment
|
||||
import com.mohiva.play.silhouette.impl.authenticators.CookieAuthenticator
|
||||
import models.{User, SnoozeInfo}
|
||||
|
||||
/**
|
||||
* Created by user on 7/15/15.
|
||||
*/
|
||||
package object controllers {
|
||||
|
||||
// Imports for all templates. Those could be added directly to the template files, but IntelliJ IDEA does not like it.
|
||||
type Dependency = com.ysoft.odc.Dependency
|
||||
type Build = com.ysoft.odc.Build
|
||||
type GroupedDependency = com.ysoft.odc.GroupedDependency
|
||||
type Vulnerability = com.ysoft.odc.Vulnerability
|
||||
type Identifier = com.ysoft.odc.Identifier
|
||||
type DateTime = org.joda.time.DateTime
|
||||
type SnoozesInfo = Map[String, SnoozeInfo]
|
||||
type AuthEnv = Environment[User, CookieAuthenticator]
|
||||
|
||||
|
||||
val NormalUrlPattern = """^(http(s?)|ftp(s?))://.*""".r
|
||||
|
||||
val TooGenericDomains = Set("sourceforge.net", "github.com", "github.io")
|
||||
|
||||
|
||||
/* def friendlyProjectName(unfriendlyName: String) = {
|
||||
val (baseName, theRest) = unfriendlyName.span(_ != '/')
|
||||
//theRest.drop(1)
|
||||
val removeLeadingMess = RestMessBeginRegexp.replaceAllIn(_: String, "")
|
||||
val removeTrailingMess = RestMessEndRegexp.replaceAllIn(_: String, "")
|
||||
val removeMess = removeLeadingMess andThen removeTrailingMess
|
||||
val subProjectOption = Some(removeMess(theRest)).filter(_ != "")
|
||||
subProjectOption.fold(baseName)(baseName+"/"+_)
|
||||
}*/
|
||||
def friendlyProjectName(reportInfo: ReportInfo) = reportInfo.subprojectNameOption.fold(reportInfo.projectName)(reportInfo.projectName+": "+_)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user