Skip to main content
Filter by
Sorted by
Tagged with
Best practices
1 vote
5 replies
78 views

this program prints a pyramid (its from a cs50 problem set). I call the function recursively by decrementing n, but i also wanted to keep track of its initial value in all the loops after the first ...
Leopold's user avatar
2 votes
1 answer
103 views

I'm building a Node.js backend using plain SQL (no ORM, just mysql2 wrapped in a small helper). However, as my project grows, my route handlers start looking messy — full of raw SQL strings embedded ...
OuterTowner's user avatar
0 votes
0 answers
41 views

I have a React Native project where I import a lot of .svg files into my components. How can I use npx knip to find all unused svg files, just like it has found all unused .js/tsx files? This is my ...
Esben von Buchwald's user avatar
0 votes
0 answers
44 views

I am trying to atleast clean the component.ts using services or somthing in my angular i have many repetitive code that i trying to fix and refactor. I am trying to apply DRY as possible can i have a ...
Jonel Teano's user avatar
0 votes
2 answers
34 views

When I run ReSharper cleanup code on a project, it adds a plus (+) sign. Is this a feature, or how do I disable it? <?xml ver.......> + <!-- ... ... -->
Magnus Calmervik's user avatar
0 votes
0 answers
41 views

Description: I'm working on a Vue/Nuxt project where we typically create a single component that handles all inputs, their state, validation, and submission to the API. While this approach works, it ...
Romin Manogil's user avatar
0 votes
0 answers
38 views

I am building a simple apm. I batch events and store them in db batched. I also want to store anything left in the batch once the process ends/killed/error This is my code export function startApm(): ...
Kristi Jorgji's user avatar
1 vote
0 answers
34 views

I have texts and text fields with the same modifiers. Instead of copying and pasting them every time, is there a way to clean them up so they're called like functions or extensions? Is there a way to ...
Alfred Wong's user avatar
1 vote
0 answers
243 views

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 ...
t3mp0ralflux's user avatar
0 votes
1 answer
768 views

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 ...
Sophie cai's user avatar
0 votes
0 answers
74 views

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 ...
TazDingo's user avatar
-2 votes
1 answer
349 views

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 ...
Leoncino's user avatar
  • 119
2 votes
2 answers
4k views

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 ...
Oleksandr Stoliarchuk's user avatar
2 votes
2 answers
950 views

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 ...
Disti's user avatar
  • 1,601
0 votes
0 answers
1k views

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 ...
Neil Franci's user avatar
4 votes
0 answers
302 views

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 ...
M.Hassan's user avatar
  • 11.2k
0 votes
1 answer
184 views

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 ...
lou34964's user avatar
0 votes
1 answer
126 views

I have this code : useEffect(() => { const init = async () => { try { socketRef.current = await initSocket(); socketRef.current.on("connect_error", (err) =&...
Nishant Sharma's user avatar
1 vote
1 answer
997 views

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 ...
Kalpesh Doru's user avatar
2 votes
1 answer
123 views

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 ...
xkk's user avatar
  • 48
0 votes
1 answer
299 views

I have internal github in our organization. There is a particular git repo where I need to replace a sensitive string from all commits. There are around 2000 commits and the sensitive string is there ...
Arun Krishnan's user avatar
0 votes
0 answers
67 views

I need to build a application to extract data from multiple JSON-Files and store it into a Database. The File looks like this and parsed results in a highly nested object. To explain, i need to go ...
Julius's user avatar
  • 108
1 vote
1 answer
474 views

Need the checkstyle configuration for unused member variables. There exists a checkstyle like below, but's just for local variables. <module name="UnusedParameterCheck"/> ( Needed a ...
Nidhi Kri 4-Yr BTech Metallurg's user avatar
1 vote
1 answer
348 views

I’m currently learning about the cleanup function in useEffect but I’m stuck on how it works in this particular example. I’m specifically stuck in the order of operations. Looking at the last three ...
Tomas Rodriguez's user avatar
0 votes
0 answers
1k views

Team, I need to identify & remove unused variables (arguments, local variables, class member variables), Libraries, and references that are unused in VS code. I have also tried to find out some ...
Chetan Sanghani's user avatar
-2 votes
1 answer
47 views

I have a form with two groupBoxes with various radioButtons each; When selecting one of them, I want to change the texts in textboxes (in each groupBox); Currently using this sequence of "if's&...
faugustom's user avatar
1 vote
0 answers
98 views

I have lots of method and on each method I have to do a validation. Currently, my code look like this and it works fine. @Service public class UserService { @Autowired private UserValidation ...
Justin Xu's user avatar
2 votes
0 answers
187 views

I decided to switch from foo == null checks to foo is null. Instead of having to search through all of my code, I set dotnet_style_prefer_is_null_check_over_reference_equality_method = true in my ....
Jonathan Siegel's user avatar
3 votes
1 answer
2k views

We already have set up eslint rules (no-unused-vars) to detect unused vars and also unused imports. What we are struggling to find is unused components, state management codes, css styles and unused ...
Bidhan Ghosh's user avatar
-2 votes
2 answers
322 views

I have solved my problem in the way I will describe below but I want to find the best way. Typescript has generic type Readonly that solved this problem. Thanks for your suggests I used folowing codes ...
BQF's user avatar
  • 113
1 vote
0 answers
31 views

In the request, I will receive a Solr-name field of type List. I need to group by solr-name name. For example, gender_s, age_f and job_s came. If these three come, I have to assign them as ...
pasaklikukuli's user avatar
-3 votes
2 answers
121 views

The code I say has to complete these assignments: Given an integer,N, perform the following conditional actions: If N is odd, print Weird If N is even and in the inclusive range of 2 to 5 , print Not ...
GabsArcan01's user avatar
0 votes
1 answer
193 views

I want to perform a cleanup procedure for my injected DLL before the injected application terminates. So I'm looking for a way to intercept ExitProcess, TerminateProcess or any termination in general. ...
Aetopia's user avatar
  • 11
0 votes
0 answers
52 views

I'm targeting a bunch of different languages in my LESS/CSS with the :lang() pseudo-class. It looks like this (but even more languages): :lang(af), :lang(sq), :lang(eu), :lang(bs), :lang(ca), :lang(kw)...
jonstieg's user avatar
  • 172
6 votes
1 answer
1k views

Why would the VS2022 Code-Cleanup feature apply different keep-tabs formatting preferences depending on whether a source file is being viewed in VS2022 or is closed? I have a new VS2022 install on a ...
camelCase's user avatar
  • 1,830
0 votes
1 answer
74 views

I have these two methods. Can someone help me to refactor and make them common? public void method1(Map<String,String> map, String key, String value){ map.put(key, value); } public void ...
hiren shah's user avatar
0 votes
2 answers
456 views

Could you please tell me how can I remove ")" from strings in a list without converting the list to a string? Example: Input: list =[ 'ABDDDDC 1,000 IWJBCKNBCDVV', 'BDISJBJ 2,000 ...
Jiaman Lee's user avatar
10 votes
1 answer
2k views

I have the following settings regarding my Tab sizing in Visual Studio 17.4.1: When I use Edit->Advanced->Format Document, I get this result: I configured Code Cleanup which allegedly contains ...
Nestor's user avatar
  • 8,444
0 votes
1 answer
735 views

I have a resend code button and will disable it for 30sec after pressed. Here is my function. const time = useRef(30); function disableResendBtn() { time.current = 30; ...
Jess's user avatar
  • 73
-2 votes
1 answer
428 views

I'm a newbie in coding javascript, to be honest there is a lot of things I don't understand but i always manage to make things work. I wrote something for odin project but i'm sure it's not as clean ...
ljaskolka's user avatar
0 votes
1 answer
96 views

I'm trying to refactor my code for higher readability and I'm new to this. I have two functions called UpFirst() and RightFirst() and they include common lines of code and I want to clean the ...
Ecem Belgin's user avatar
0 votes
0 answers
32 views

I have an application with plenty of third-party packages in it, some of them are not required, and few packages have many versions installed in the environment. Is there any tool or method to detect ...
DilLip_Chowdary's user avatar
4 votes
2 answers
3k views

Premise I'm trying to convert some PDF to images via pdf2image and poppler, to then run some computervision tasks on. The conversion itself works fine. However, the conversion creates some artifacts ...
Liqs's user avatar
  • 197
1 vote
0 answers
439 views

I am building a next.js website and intend to include Google AdSense at some point in the future. After following some examples and implementing the scripts as per a Next project I am hitting a wall ...
John E's user avatar
  • 186
0 votes
1 answer
321 views

I am currently creating an API for posting in backend with nodejs. My data object, which gets provided from the frontend contains multiple objects. My first step is to check if these multiple consts ...
Daniel's user avatar
  • 11
1 vote
1 answer
5k views

This is my old implementation of the Tabs component in Ant Design. const tabList = [ { key: "tab1", label: "Tab1", children: <Tab1 />, }, { key: "...
user avatar
0 votes
1 answer
646 views

We have a ruby rails project which we normally get from our enterprise github repository. Recently, I've added dependencies that for some reason breaks my other projects that are not related to the ...
Reydan Gatchalian's user avatar
0 votes
1 answer
30 views

while True: month_num = int(input("enter the month number: ")) if month_num == 1: print("january") elif month_num == 2: print("February") ...
saif's user avatar
  • 1
0 votes
1 answer
613 views

I have a C# task that I'd like to re run if a certain exception type is thrown. This is what I have currently: bool retry = true; int numOfRetries = 3; int tries; while (retry = true && tries ...
Rockets23's user avatar
0 votes
1 answer
502 views

I found the code cleanup options but I want to apply them only on lines that have been edited and not the entire file. Is this possible to achieve?
Berecz Balázs's user avatar

1
2 3 4 5
13