Questions tagged [code-cleanup]
Code cleanup refers to the act of writing code so that it cleans up leftover data structures and other unwanted materials from memory and the filesystem. It is not the same as refactoring code, which involves making the source code itself easier to understand, maintain, and modify.
code-cleanup
642
questions
0
votes
0
answers
9
views
Use versioned Formatter, Inspections and Code Cleanup Configs in IntelliJ
I have configured an IntelliJ Formatter, Code Cleanup and Inspections Profile. I want to check in these profiles so my team members can use them. The problem is: They have to import these settings ...
1
vote
0
answers
81
views
JetBrains Rider removing space between delegate keyword and parenthesis
On my team, some of us use Rider, others use Visual Studio 2022. When they run code cleanup, VS 2022 adds a space between delegate and () as seen here:
var cat = this.ExecuteAFunction("Function ...
0
votes
0
answers
23
views
How can I get to VBA code that copies values & pastes them into a tblStaging, pastes those values into a tblTarget, & appends the tblTarget thereafter
I have values in a work report that need to essentially get copy & pasted into tblStaging & tblTarget, and allow for the same thereafter. So, e.g., a team "Ravens" and city "...
0
votes
1
answer
154
views
Visual Studio Code Cleanup: How to avoid removing unassgiend/unused variable when file is on save
I am using Code Cleanup in Visual Studio and noticed when file is on save.
The unused variable will be removed like:
I tried editing the .editorConfig file but it didn't seem to work with any of the ...
0
votes
0
answers
33
views
Getting "MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it." after I stop play mode
I'm still learning Unity. I have quite a few objects and scripts in the scene and they interact with each other. I'm getting "MissingReferenceException: The object of type 'GameObject' has been ...
-1
votes
1
answer
101
views
Run cleanup function in Python when Jenkins job is aborted
I wrote a script in Python that is running for some time and performing a clean up as soon as it terminates regularly like:
import time
def cleanUp():
#delete some temporary files and so on
...
0
votes
0
answers
60
views
Jetpack Compose and code clean up: Move funtions outside of my Composable into a view model or helper class?
I have the following code, and would like to clean it up to have better separation of responsibilities.
Do I move the logic outside into a view model, create a class called AccountSummaryFormatter, or ...
1
vote
2
answers
508
views
React-query infiniteQuery - how to fix additional pageParam type checking
i have bumped into following issue, i'm trying to implement infiniteQuery by using react-query tanstack, but i can't do it without additional checking of pageParam on it's type of number.
Could you ...
2
votes
2
answers
343
views
C# - VS2022: "global using" and code cleanup on save
In VS2022 I turned on the very useful feature "Run Code Cleanup profile on Save".
With this option on, every unneeded using statement in code gets removed automatically on save.
Now I would ...
0
votes
0
answers
442
views
How to use Playwright locators to replace evaluateAll and querySelector?
I'm trying to get data from a webpage using Playwright in TypeScript. I have a section of code where I want to extract information from multiple elements matching a certain locator.
However, I'm ...
4
votes
0
answers
184
views
In c# code cleanup, How to stop visual studio 2022 adding comments /* Unmerged change from project 'xxxx (net6.0)'
Environment:
Visual studio 2022, v17.8.3 with net8 support
I did cleanup to c# solution with 6 projects using profile2 .
I found that vs 2022 during code cleanup using profile2 add these like ...
0
votes
1
answer
103
views
I want to read in a csv file to a .NET datatable with respect to data column datatypes
I have a way to do this that works as shown below, but I really want to see if there is a cleaner way to do this without using a CSV library or package.
public static void Read(string ...
0
votes
1
answer
69
views
Socket connection does not disconnect at useEffect cleanup function
I have this code :
useEffect(() => {
const init = async () => {
try {
socketRef.current = await initSocket();
socketRef.current.on("connect_error", (err) =&...
1
vote
1
answer
458
views
How to Organize Compose Imports by Moving Them to Another File and Importing in Another Screen?
I'm working on an Android project using Jetpack Compose, and I have a screen with a long list of imports at the top. I want to clean up the code and make it more organized. Is there a way to move ...
2
votes
1
answer
94
views
Code cleanup adds spaces in interpolated strings
I have a problem with Resharper code cleanup, it turns out that there is some collision/setting in my editor config that causes spaces to be added in the interpolated text, spoiling the result. The ...