automated-refactoring Questions

3

I believe my source code files feature many imports that are not used in the code (as I have a bad habit of copying them from existing to new files). When coding C# in Visual Studio (or, mayb...
Eggplant asked 14/10, 2011 at 12:27

5

Solved

I'm working on a big Python code base that grows and grows and grows. It's not a single application - more of a bunch of experiments that share some common code. Every so often, I want to make a ...
Gershon asked 7/11, 2016 at 16:10

1

Using pycharm, I wish to refactor methods into a class. (Staticmethod would do) Current: import math class Solver(object): def __init__(self, a, b, c): self.a = a self.b = b self.c = c def ...
Ician asked 17/5, 2017 at 17:14

1

Solved

Is there a way to do all the lightbulb-action for a whole Solution and with a button or a shortcut? Or to add a using for a term which could be simplyfied but is not shown through a lightbulb? I...
Torchier asked 12/4, 2017 at 9:3

4

Solved

I have lots of header files with long method implementation inside. Is there An automatic way of doing that? One-by-one can take a lot of time... Thanks.
Tentmaker asked 15/6, 2011 at 19:13

3

I want to make order of functions in header .h to be consistent with the order of functions in source file .cpp. Example B.h class B{ void f2(); //<--- wrong order void f1(); }; B.cpp #i...
Syphon asked 11/1, 2017 at 3:38

1

Solved

How do I perform a Boolean To Enum refactor in IntelliJ IDEA? For example, convert this: void changeLights(boolean isOn) { this.isOn = isOn; } changeLights(true); changeLights(false); Into t...

3

I'm looking for a tool to find duplicate or similar code of Java/Javascript. I can't tell the exact definition of "similar", but I wish the tool is smart enough and give me advices to refacto...
Agro asked 25/11, 2016 at 6:49

2

I'm making a command line nodejs tool that automates renaming symbols in Typescript files, using the Typescript language services. You tell the tool: rename all symbols of this type to this symbol...

4

Solved

For example I have many classes than implement my interface. After adding new method definition in the interface, how can I fast-add blank interface implementations for all that classes?
Crapshooter asked 18/1, 2013 at 14:46

1

This question is a follow-up for this. Say I have some class Foo. class Foo { protected String x = "x"; public String getX() { return x; } } I have a program that uses Foo and viola...

2

Let's say I have a "magic string" in four classes and I want it to be replaced in all places by one constant from some constants class. (I'm speaking about Java/Groovy classes but any other languag...
Pilliwinks asked 5/1, 2015 at 13:58

1

Solved

Say I have some class Foo class Foo { protected String x = "x"; public String getX() { return x; } } I have a program that uses Foo and violates LoD class Bar { protected Foo foo; publ...

1

I have a class with many (approximately 40) methods with names in SCREAMING_CASE_LIKE_THIS. Is there a quick way, perhaps via the code analysis/inspections, to rename all of these to more idiomati...
Latvina asked 7/1, 2013 at 23:25

6

I am trying to re factor some code by breaking a class into several other classes. to do so i want to move some methods already existing in my old class to new class. But these methods are being re...
Diathesis asked 15/11, 2013 at 6:39

2

Solved

I have these enums: private enum FontSizeType { XSmall, //9 Small, //12 Medium, //18 Large, //24 XLarge, //36 XXLarge //47 } private enum AlignOptions { Left, Center, Right } pr...

2

Solved

Is there a tool for automatic java code simplification via refactoring? There are such tools for Python and C: Automatically simplifying/refactoring Python code (e.g. for loops -> list ...
Swinton asked 23/1, 2015 at 22:27

2

Solved

Is there a way to perform the opposite of the "Extract Method" refactor in Visual Studio? I have a legacy codebase that has ~50 very short, private functions that are only used once each, and I h...

5

Solved

I use vim as my editor but I would like to get some of the same power of the IDE's for java when it comes to refactoring. Are there any commandline tools for refactoring java? I could probabl...
Perjury asked 1/4, 2009 at 4:22

3

Solved

I've been stuck with the unpleasant task of "unminifying" a minified JavaScript code file. Using JSBeautifier, the resulting file is about 6000 lines long. Ordinarily, the variable and parameter n...

1

It used to be that when I renamed a class file (maybe also others) in VS2012, it prompted me to renamed everything, then did a nice refactor after renaming the class to the new file name. It sudden...
Wilburwilburn asked 9/11, 2013 at 11:4

2

Is Xcode 5 able to change method's signature? As far as I can tell no, but I'd like to be shown wrong. If I either try to add (or remove) a method's parameter, I am welcomed by the Needs 1 fewer (...
Shore asked 20/2, 2013 at 18:31

1

This has implications on code portability of C++11 code in general. I am talking about having a new code generation stage akin to the C/C++ preprocessor stage wherein we can make the generated C++ ...
Tappet asked 4/7, 2013 at 22:25

1

Solved

Is there a way to transform automatically this static method invocation (Arrays.asList): import java.util.Arrays; import java.util.List; public class StaticImport { public static void main(Strin...
Rancid asked 22/3, 2013 at 9:55

6

I am about to starting to work on a project which involves refactoring and modifying existing code which is in c & c++. The code is a bloated one and is in huge volume. Of course since the code...
Lorettelorgnette asked 23/9, 2010 at 9:34

© 2022 - 2024 — McMap. All rights reserved.