Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit d5914ed

Browse files
committed
Removed all TODOs from framework and API. Open problems and enhancements are now stored in the github issues of the main project.
1 parent 2cde2f9 commit d5914ed

File tree

18 files changed

+4
-47
lines changed

18 files changed

+4
-47
lines changed

bootstrap/src/main/scala/Bootstrap.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ object Bootstrap {
115115
val dependencies = getDependencies
116116

117117
// Download all libraries
118-
// TODO: Check validity if everything is downloaded
119118
// try downloading libs and only if it succeeded (returned true) then try to delete older libs
120119
downloadMissingLibraries(dependencies) && deleteUndesiredLibraries(dependencies)
121120
}

deployment-files/README.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
<body>
88
<p>Thank you for downloading Chat Overflow! For more information, please visit <a href="http://codeoverflow.org">codeoverflow.org</a>!
99
</p>
10-
<!-- TODO: Write proper readme with the most important information and version infos about the deployed framework, api, client, gui -->
1110
</body>
1211
</html>

project/BuildUtility.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ class BuildUtility(logger: ManagedLogger) {
118118
}
119119

120120
// Clean first
121-
// TODO: Should not be cleaned. Existent files should be overwritten.
122121
for (jarFile <- pluginTargetFolder.listFiles().filter(_.getName.endsWith(".jar"))) {
123122
try {
124123
jarFile.delete()
@@ -150,9 +149,6 @@ class BuildUtility(logger: ManagedLogger) {
150149
def createPluginTask(pluginFolderNames: List[String]): Unit = {
151150
withTaskInfo("CREATE PLUGIN") {
152151

153-
// TODO: Generated plugin structure should contain ready-to-implement files
154-
// TODO: BuildUtility / Build Environment should be refactored to enable separate plugin dev environments with a subset of sbt functionality
155-
156152
// Plugin folders have to be defined in the build.sbt file first
157153
if (pluginFolderNames.isEmpty) {
158154
println("Before creating a new plugin, please define at least one plugin source folder in the build.sbt file.")

src/main/scala/org/codeoverflow/chatoverflow/Launcher.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ object Launcher extends WithLogger {
3636
}
3737

3838
// Start plugins if specified
39-
// TODO: Move this down after server start when the REPL is history
4039
if (chatOverflow.isLoaded && config.startupPlugins.nonEmpty) {
4140
for (instanceName <- config.startupPlugins) {
4241
val instance = chatOverflow.pluginInstanceRegistry.getPluginInstance(instanceName)
@@ -49,8 +48,6 @@ object Launcher extends WithLogger {
4948
}
5049
}
5150

52-
// TODO: Delete REPL, update CLI, update wiki
53-
5451
// Launch UI
5552
config.ui match {
5653
case UI.GUI =>
@@ -80,7 +77,6 @@ object Launcher extends WithLogger {
8077
*/
8178
def exit(): Unit = {
8279
logger info "Shutting down Chat Overflow."
83-
// TODO: Deal with running plugins, connectors, ...
8480
System.exit(0)
8581
}
8682
}

src/main/scala/org/codeoverflow/chatoverflow/configuration/ConfigurationService.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ class ConfigurationService(val configFilePath: String) extends WithLogger {
107107
* Loads the config xml file and return its content.
108108
*/
109109
private def loadXML(): Node = {
110-
// TODO: Add some XML caching here
111110
if (!new File(configFilePath).exists()) {
112111
logger debug s"Config file '$configFilePath' not found. Initialising with default values."
113112
saveXML(defaultContent)
@@ -247,7 +246,6 @@ object ConfigurationService extends WithLogger {
247246
targetType: String, content: String,
248247
pluginInstanceRegistry: PluginInstanceRegistry,
249248
typeRegistry: TypeRegistry): Boolean = {
250-
// FIXME: Better handling of empty content (not set in the first place, then read from XML)
251249

252250
logger info s"Loading requirement '$requirementId' of type '$targetType'."
253251
val instance = pluginInstanceRegistry.getPluginInstance(instanceName)

src/main/scala/org/codeoverflow/chatoverflow/configuration/CryptoUtil.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import javax.crypto.{Cipher, SecretKeyFactory}
1717
*/
1818
object CryptoUtil {
1919

20-
// TODO: This code should be reviewed by an expert to find potential security issues.
21-
2220
// Used for the run-unique auth key
2321
private val runSpecificRandom = generateIV
2422

src/main/scala/org/codeoverflow/chatoverflow/connector/actor/JsonActor.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import org.json4s.jackson.JsonMethods._
1010
*/
1111
class JsonActor extends Actor {
1212

13-
// TODO: Implement proper functionality with json4s. This is not more than a proof of concept
14-
// TODO: Test, when reflection kicks in to allow the most functionality without an actor call
15-
1613
/**
1714
* Receives a ParseJSON Object to start parsing.
1815
*

src/main/scala/org/codeoverflow/chatoverflow/framework/manager/PluginManagerImpl.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import scala.collection.mutable.ListBuffer
1515
*/
1616
class PluginManagerImpl(pluginInstanceName: String, logOutputOnConsole: Boolean) extends PluginManager with WithLogger {
1717

18-
// TODO: Add log datetime
1918
private val logMessages = new ListBuffer[String]
2019

2120
/**

src/main/scala/org/codeoverflow/chatoverflow/instance/PluginInstance.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,10 @@ class PluginInstance(val instanceName: String, pluginType: PluginType) extends W
164164
if (plugin.get.getLoopInterval > 0) {
165165
while (!threadStopAfterNextIteration) {
166166
plugin.get.loop()
167-
// FIXME: This is not a loop interval. Should be responsive to the loop runtime
168167
Thread.sleep(plugin.get.getLoopInterval)
169168
}
170169
}
171170

172-
// TODO: Also connectors & input/output should be shutdown somewhere (if the plugin ends OR is ended)
173-
174171
// After the loop (or setup) the plugin should end
175172
plugin.get.shutdown()
176173

src/main/scala/org/codeoverflow/chatoverflow/registry/TypeRegistry.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class TypeRegistry(requirementPackage: String) extends WithLogger {
5353
connectorTypes.clear()
5454

5555
// Use reflection magic to get all impl-annotated classes
56-
// FIXME: Does also find definitions not in the exact package - not intended should be filtered afterwards
5756
val reflections: Reflections = new Reflections(new ConfigurationBuilder()
5857
.setUrls(ClasspathHelper.forPackage(requirementPackage))
5958
.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner()))

src/main/scala/org/codeoverflow/chatoverflow/requirement/service/mockup/MockUpChatConnector.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import org.codeoverflow.chatoverflow.connector.Connector
99
import scala.collection.mutable.ListBuffer
1010
import scala.io.Source
1111

12+
@Deprecated
1213
class MockUpChatConnector(sourceIdentifier: String) extends Connector(sourceIdentifier) with WithLogger {
1314

1415
private val mockUpFolder = "src/main/resources/mockup"
@@ -25,11 +26,9 @@ class MockUpChatConnector(sourceIdentifier: String) extends Connector(sourceIden
2526
}
2627

2728
def addPrivateMessageEventListener(listener: ChatMessage[ChatMessageAuthor, Channel, ChatEmoticon] => Unit): Unit = {
28-
// FIXME: Support private messages
2929
}
3030

3131
def simulateChat(): Unit = {
32-
// FIXME: Should be invoked every x milliseconds using actors not using sleep
3332
val step = 100
3433
while (running) {
3534
val currentTime = Calendar.getInstance.getTimeInMillis
@@ -43,7 +42,6 @@ class MockUpChatConnector(sourceIdentifier: String) extends Connector(sourceIden
4342
}
4443

4544
def loadMockUpFile(): Boolean = {
46-
// TODO: Handle exceptions
4745
val input = Source.fromFile(s"$mockUpFolder/$sourceIdentifier.chat")
4846
val lines = input.getLines()
4947

@@ -52,7 +50,6 @@ class MockUpChatConnector(sourceIdentifier: String) extends Connector(sourceIden
5250
messages = createMessageList(elements)
5351
input.close()
5452
true
55-
// TODO: Do not always return true
5653
}
5754

5855
/**
@@ -63,7 +60,6 @@ class MockUpChatConnector(sourceIdentifier: String) extends Connector(sourceIden
6360
*/
6461
private def createMessageList(elements: List[MockupElement]): List[ChatMessage[ChatMessageAuthor, Channel, ChatEmoticon]] = {
6562

66-
// FIXME: WHY (don't use a static offset you dumb brick)
6763
time = Calendar.getInstance().getTimeInMillis + 5000L
6864
logger.info(s"Started MockupChat Construction with timestamp: $time")
6965

@@ -82,7 +78,6 @@ class MockUpChatConnector(sourceIdentifier: String) extends Connector(sourceIden
8278
currentIndex = returnValue._2
8379
messageList ++= newElements
8480

85-
// FIXME: There might be cases where this ends up in while(true). Should be tested!
8681
} while (currentIndex < elements.size)
8782

8883
logger.info("Finally returning %d messages.".format(messageList.size))
@@ -113,8 +108,7 @@ class MockUpChatConnector(sourceIdentifier: String) extends Connector(sourceIden
113108
allElements(index) match {
114109
case ChatElement(user, msg, isPremium) =>
115110
logger.info(s"Read ChatElement($user,$msg,$isPremium).")
116-
//FIXME isTrubo is not supported by the new api implementation.
117-
// Remove it or create MockupChatMessageAuthor that has field isTrubo
111+
118112
messageList += new ChatMessage(new ChatMessageAuthor(user), msg, time, new Channel("default"))
119113
time += defaultDelay
120114
case DelayElement(delay) =>

src/main/scala/org/codeoverflow/chatoverflow/requirement/service/mockup/impl/MockUpChatInputImpl.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ import org.codeoverflow.chatoverflow.requirement.service.mockup.MockUpChatConnec
1313
import scala.collection.JavaConverters._
1414
import scala.collection.mutable.ListBuffer
1515

16+
@Deprecated
1617
@Impl(impl = classOf[MockUpChatInput], connector = classOf[MockUpChatConnector])
1718
class MockUpChatInputImpl extends Connection[MockUpChatConnector] with MockUpChatInput with WithLogger {
1819

19-
// TODO: Rewrite code to fit to the new framework style using actors, a new parser, extend InputImpl etc.
20-
2120
private val messages: ListBuffer[ChatMessage[ChatMessageAuthor, Channel, ChatEmoticon]] = ListBuffer[ChatMessage[ChatMessageAuthor, Channel, ChatEmoticon]]()
2221
private val privateMessages: ListBuffer[ChatMessage[ChatMessageAuthor, Channel, ChatEmoticon]] = ListBuffer[ChatMessage[ChatMessageAuthor, Channel, ChatEmoticon]]()
2322

@@ -44,7 +43,6 @@ class MockUpChatInputImpl extends Connection[MockUpChatConnector] with MockUpCha
4443
override def init(): Boolean = {
4544
if (sourceConnector.isDefined) {
4645
sourceConnector.get.addMessageEventListener(onMessage)
47-
// FIXME: Work with private messages
4846
sourceConnector.get.init()
4947
} else {
5048
logger warn "Source connector not set."

src/main/scala/org/codeoverflow/chatoverflow/requirement/service/serial/SerialConnector.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class SerialConnector(override val sourceIdentifier: String) extends Connector(s
5151
if (serialPort.isEmpty) throw new IllegalStateException("Serial port is not available yet")
5252
serialPortInputListener.addDataAvailableListener(_ => {
5353
val buffer = new Array[Byte](serialPort.get.bytesAvailable())
54-
serialPort.get.readBytes(buffer, buffer.length) //FIXME DOES IT CRASH?
54+
serialPort.get.readBytes(buffer, buffer.length)
5555
listener(buffer)
5656
})
5757
}
@@ -60,7 +60,6 @@ class SerialConnector(override val sourceIdentifier: String) extends Connector(s
6060
* Opens a connection with the serial port
6161
*/
6262
override def start(): Boolean = {
63-
//TODO Test if connector is working this way or if it requires an actor
6463
try {
6564
serialPort = Some(SerialPort.getCommPort(credentials.get.getValue("port").get))
6665
credentials.get.getValue("baudRate") match {

src/main/scala/org/codeoverflow/chatoverflow/requirement/service/twitch/api/TwitchAPIConnector.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import org.codeoverflow.chatoverflow.framework.actors.HttpClientActor
1414
import scala.concurrent.Await
1515
import scala.concurrent.duration._
1616

17-
// FIXME: Chery picked from Class Library Rework, should be reworked, lol
18-
1917
/**
2018
* The twitch api connector
2119
*
@@ -89,7 +87,6 @@ class TwitchAPIConnector(override val sourceIdentifier: String) extends Connecto
8987
* This stops the activity of the connector, e.g. by closing the platform connection.
9088
*/
9189
override def stop(): Boolean = {
92-
// TODO: Implement STOP
9390
false
9491
}
9592

src/main/scala/org/codeoverflow/chatoverflow/requirement/service/twitch/api/impl/TwitchStatImpl.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import org.codeoverflow.chatoverflow.requirement.service.twitch.api.TwitchAPICon
1313
import scala.concurrent.Await
1414
import scala.concurrent.duration._
1515

16-
// FIXME: Chery picked from Class Library Rework, should be reworked, lol
17-
1816
case class UserResult(data: Seq[UserEntity])
1917

2018
case class UserEntity(id: String, login: String, display_name: String, `type`: String, broadcaster_type: String, description: String, profile_image_url: String, offline_image_url: String, view_count: Int)
@@ -47,7 +45,6 @@ class TwitchStatInputImpl extends Connection[TwitchAPIConnector] with TwitchStat
4745
else null
4846
}
4947

50-
// FIXME: Kicked jackson mapping (deprecated?!), different way needed
5148
def map[T: Manifest](content: String): Any = {
5249
//val mapper = new ObjectMapper() with ScalaObjectMapper
5350
// mapper.registerModule(DefaultScalaModule)

src/main/scala/org/codeoverflow/chatoverflow/requirement/service/twitch/chat/TwitchChatConnector.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ class TwitchChatConnector(override val sourceIdentifier: String) extends Connect
103103
errorCount += 1
104104
}
105105

106-
// TODO: Enable detection for wrong credentials / bot disconnect
107-
108106
if (errorCount >= 30) {
109107
logger error "Fatal. Unable to start bot."
110108
}

src/main/scala/org/codeoverflow/chatoverflow/ui/CLI.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ object CLI {
3030
opt[String]('r', "requirementPackage").action((x, c) =>
3131
c.copy(requirementPackage = x)).text("path to the package where all requirements are defined")
3232

33-
// TODO: Update
3433
// Subject of change. After GUI will be -l (for login)
3534
opt[Unit]('n', "noPassword").action((_, c) =>
3635
c.copy(requirePasswordOnStartup = false)).text("set this flag to disable password checking on framework startup")
@@ -84,8 +83,6 @@ object CLI {
8483
loginPassword: Array[Char] = Array[Char](),
8584
startupPlugins: Seq[String] = Seq[String]())
8685

87-
// TODO: Fix path layout
88-
8986
object UI extends Enumeration {
9087
type UI = Value
9188
val GUI, REPL, BOTH = Value

src/main/scala/org/codeoverflow/chatoverflow/ui/web/Server.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class Server(val chatOverflow: ChatOverflow, val port: Int) extends WithLogger {
2626
* Starts the server in a new thread.
2727
*/
2828
def startAsync(): Unit = {
29-
// TODO: Enable shutting down the server
3029
new Thread(() => startServer()).start()
3130

3231
println(s"You may open now: http://petstore.swagger.io/?url=http://localhost:$port/api-docs/swagger.json")

0 commit comments

Comments
 (0)