All Questions
Tagged with refactoring automated-refactoring
171 questions
0
votes
1
answer
28
views
How do I move a method in a Typescript project?
I am working with Playwright on a test automation project. I already have several Pages classes and would now like to move a method from one class to another. This already has various references.
Is ...
2
votes
1
answer
70
views
Add custom refactoring pattern using Resharper
I have hundreds occurences of this kind of lines in my app :
public ICommand MyCommandName => ReactiveCommand.Create(TriggerCommand);
I tried without luck to add a Custom Pattern in resharper to ...
-1
votes
1
answer
195
views
Automatically add hierarchies in Verilog code
I have a working code generator, that on top-level, just instantiates modules and takes care of all the connectivty - that one is proven to be working.
I would like now to partition some of the ...
2
votes
2
answers
207
views
Is there a generic way to make deep recursive functions work without changing system recursion limit?
We have a Python codebase containing quite a lot recursive functions, they may run into deep recursions and break the recursion limit with default Python interpreter settings. We have used sys....
0
votes
1
answer
84
views
Is there a preferred method to reorganise C header files in a project?
I have been given a medium-sized but complex C project (about 200,000 lines in total) which contains around 100 .h files and nearly as many .c files.
Many of the .h files correspond to equivalent .c ...
0
votes
0
answers
43
views
Refactor all getters / setters not to start with a leading get / set across entire Java codebase
I'm looking for a suggestion on how to refactor a +50K lines of Java.
Inspired by version 2.x of the AWS SDK for Java, which has many builders and almost no getters / setters that start with a leading ...
2
votes
1
answer
680
views
Is it possible to replace "auto" with its deduced type, automatically, in C++?
I've got a project I've been wrestling with for a while, which is almost ready for submission; but there have been a few previous coders who have contributed. Their code is great, but it doesn't ...
9
votes
3
answers
1k
views
How to automate Java code refactoring using a script with instructions?
How to refactor this class programmatically via Java code/Groovy plugin?
Let's say, I need to:
Rename foo.method2 to foo.method3
Rename myMethod to yourMethod
Change the imported package org.you.core....
1
vote
0
answers
342
views
Customize Refactoring for Python in Visual Studio Code
This is a small quality of life issue, but I'm curious if there is a solution.
I'm working with a python file in visual studio code. I'm using the "Extract Method" feature to do some ...
-2
votes
1
answer
31
views
Is there a regex or other tool I can use to change a method call to a function call that encloses the previous expression?
I'm working on making a change to a large C++ codebase where I need to change a method call to an equivalent function call, e.g. someExpression.foo() becomes bar(someExpression).
A few more examples ...
0
votes
0
answers
124
views
WebStorm - Object structure refactoring
In WebStorm, I would really like to know if there's a way to refactor the structure of objects.
Let's say I have this object,
inventory = {
fruits: [
{type: 'apple', quantity: 24},
{type: '...
1
vote
1
answer
141
views
C++ function called in multiple places, how to refactor to accept a new argument?
I have this function f(MyType a, b) and I want to it to become f(MyType a, b, c). The problem is that f is called by multiple other functions (g(), h(), i()) which in turn are called by multiple other ...
10
votes
1
answer
1k
views
Is there a way I can define a custom refactoring in Visual Studio Code?
It is possible to define custom snippets of code that VS Code can auto complete. These can even use place-holders so that one can fill in the blanks as required.
/* Before */
//=
/* After (for ...
1
vote
1
answer
1k
views
VS Code refactoring in JS doesn't seem to work in unopened files
When trying to refactor function names, variable names, or class names within all files using F2 (as shown at https://code.visualstudio.com/docs/editor/refactoring#_rename-symbol), I only seem to have ...
2
votes
1
answer
225
views
Automatic replacement of indirect imports
I have a small module that defines a function:
# small_file.py
def func():
...
I have a larger module that does a wildcard import of that one:
# giant_file.py
from small_file import *
...
I have ...