Add todos

This commit is contained in:
2026-02-10 13:44:21 +01:00
parent 45fb1921da
commit c4bed3f050
12 changed files with 18 additions and 0 deletions

View File

@@ -12,6 +12,8 @@ import org.springframework.stereotype.Component;
@Component @Component
public class SchemaMigration implements ApplicationRunner { public class SchemaMigration implements ApplicationRunner {
// TODO: Code smell Runtime schema migration logic duplicates Flyway responsibilities and is difficult to reason about/test.
private static final Logger logger = LoggerFactory.getLogger(SchemaMigration.class); private static final Logger logger = LoggerFactory.getLogger(SchemaMigration.class);
private final JdbcTemplate jdbcTemplate; private final JdbcTemplate jdbcTemplate;

View File

@@ -56,6 +56,8 @@ import org.springframework.web.server.ResponseStatusException;
@SecurityRequirement(name = "twitchOAuth") @SecurityRequirement(name = "twitchOAuth")
public class ChannelApiController { public class ChannelApiController {
// TODO: Code smell Controller surface area is very large, suggesting too many endpoint responsibilities in one type.
private static final Logger LOG = LoggerFactory.getLogger(ChannelApiController.class); private static final Logger LOG = LoggerFactory.getLogger(ChannelApiController.class);
private final ChannelDirectoryService channelDirectoryService; private final ChannelDirectoryService channelDirectoryService;
private final OAuth2AuthorizedClientService authorizedClientService; private final OAuth2AuthorizedClientService authorizedClientService;

View File

@@ -60,6 +60,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ResponseStatusException;
@Service @Service
// TODO: Code smell God class; this service mixes admin management, asset CRUD, media processing, websocket publishing, and marketplace concerns.
public class ChannelDirectoryService { public class ChannelDirectoryService {
private static final Logger logger = LoggerFactory.getLogger(ChannelDirectoryService.class); private static final Logger logger = LoggerFactory.getLogger(ChannelDirectoryService.class);
@@ -74,6 +75,7 @@ public class ChannelDirectoryService {
AssetType.OTHER AssetType.OTHER
); );
// TODO: Code smell Constructor has too many dependencies, indicating high coupling and too many responsibilities.
private final ChannelRepository channelRepository; private final ChannelRepository channelRepository;
private final AssetRepository assetRepository; private final AssetRepository assetRepository;
private final VisualAssetRepository visualAssetRepository; private final VisualAssetRepository visualAssetRepository;

View File

@@ -22,6 +22,8 @@ import org.springframework.stereotype.Component;
@Component @Component
public class MarketplaceScriptSeedLoader { public class MarketplaceScriptSeedLoader {
// TODO: Code smell Large parser/loader with many branching paths; consider decomposing into smaller collaborators.
private static final Logger logger = LoggerFactory.getLogger(MarketplaceScriptSeedLoader.class); private static final Logger logger = LoggerFactory.getLogger(MarketplaceScriptSeedLoader.class);
private static final String METADATA_FILENAME = "metadata.json"; private static final String METADATA_FILENAME = "metadata.json";
private static final String SOURCE_FILENAME = "source.js"; private static final String SOURCE_FILENAME = "source.js";

View File

@@ -30,6 +30,8 @@ import org.springframework.web.util.UriComponentsBuilder;
@Service @Service
public class SevenTvEmoteService { public class SevenTvEmoteService {
// TODO: Code smell Service handles transport, parsing, and storage concerns together instead of focused components.
private static final Logger LOG = LoggerFactory.getLogger(SevenTvEmoteService.class); private static final Logger LOG = LoggerFactory.getLogger(SevenTvEmoteService.class);
private static final String USERS_URL = "https://api.twitch.tv/helix/users"; private static final String USERS_URL = "https://api.twitch.tv/helix/users";
private static final String USER_EMOTE_URL = "https://7tv.io/v3/users/twitch/"; private static final String USER_EMOTE_URL = "https://7tv.io/v3/users/twitch/";

View File

@@ -34,6 +34,8 @@ import org.springframework.web.util.UriComponentsBuilder;
@Service @Service
public class TwitchEmoteService { public class TwitchEmoteService {
// TODO: Code smell Service bundles API client calls, caching, disk persistence, and async scheduling in one class.
private static final Logger LOG = LoggerFactory.getLogger(TwitchEmoteService.class); private static final Logger LOG = LoggerFactory.getLogger(TwitchEmoteService.class);
private static final String GLOBAL_EMOTE_URL = "https://api.twitch.tv/helix/chat/emotes/global"; private static final String GLOBAL_EMOTE_URL = "https://api.twitch.tv/helix/chat/emotes/global";
private static final String CHANNEL_EMOTE_URL = "https://api.twitch.tv/helix/chat/emotes"; private static final String CHANNEL_EMOTE_URL = "https://api.twitch.tv/helix/chat/emotes";

View File

@@ -1,3 +1,4 @@
// TODO: Code smell Monolithic admin console logic centralizes rendering, transport, and interaction handling in one file.
import { isAudioAsset } from "../media/audio.js"; import { isAudioAsset } from "../media/audio.js";
import { isApngAsset, isCodeAsset, isGifAsset, isModelAsset, isVideoAsset, isVideoElement } from "../broadcast/assetKinds.js"; import { isApngAsset, isCodeAsset, isGifAsset, isModelAsset, isVideoAsset, isVideoElement } from "../broadcast/assetKinds.js";
import { createModelManager } from "../media/modelManager.js"; import { createModelManager } from "../media/modelManager.js";

View File

@@ -8,6 +8,7 @@ import { createMediaManager } from "./mediaManager.js";
import { createModelManager } from "../media/modelManager.js"; import { createModelManager } from "../media/modelManager.js";
export class BroadcastRenderer { export class BroadcastRenderer {
// TODO: Code smell Renderer class accumulates networking, state management, media orchestration, and rendering responsibilities.
constructor({ canvas, scriptLayer, broadcaster, showToast }) { constructor({ canvas, scriptLayer, broadcaster, showToast }) {
this.canvas = canvas; this.canvas = canvas;
this.ctx = canvas.getContext("2d"); this.ctx = canvas.getContext("2d");

View File

@@ -330,6 +330,7 @@ function createScriptHandlers(source, context, state, sourceLabel = "") {
return factory(context, state, module, exports); return factory(context, state, module, exports);
} }
// TODO: Code smell Worker command handling relies on a long conditional dispatcher that is hard to maintain.
self.addEventListener("message", (event) => { self.addEventListener("message", (event) => {
const { type, payload } = event.data || {}; const { type, payload } = event.data || {};
if (type === "init") { if (type === "init") {

View File

@@ -1,3 +1,4 @@
// TODO: Code smell Large modal module with extensive mutable state and mixed UI/network responsibilities.
export function createCustomAssetModal({ export function createCustomAssetModal({
broadcaster, broadcaster,
adminChannels = [], adminChannels = [],

View File

@@ -1,3 +1,4 @@
// TODO: Code smell Dashboard script uses broad shared state and imperative DOM updates instead of focused components.
const elements = { const elements = {
adminList: document.getElementById("admin-list"), adminList: document.getElementById("admin-list"),
suggestionList: document.getElementById("admin-suggestions"), suggestionList: document.getElementById("admin-suggestions"),

View File

@@ -1,3 +1,4 @@
// TODO: Code smell Script performs global DOM lookups/state mutation at module load, increasing coupling and test difficulty.
const formElement = document.getElementById("settings-form"); const formElement = document.getElementById("settings-form");
const submitButtonElement = document.getElementById("settings-submit-button"); const submitButtonElement = document.getElementById("settings-submit-button");
const canvasFpsElement = document.getElementById("canvas-fps"); const canvasFpsElement = document.getElementById("canvas-fps");