automated-refactoring

Automatically split (refactor) .h into header and implementation (h+cpp)

若如初见. 提交于 2020-06-08 03:41:26
问题 When writing C++ code, I often start by writing full 'implementation' code in my header files, then later need to refactor the implementation into a .cpp file. This is great, but I find this process laborious, but otherwise pretty easy, so I wondered about whether is there any automated way to do this? Specifically, I want to convert all class and function definitions in the .h to declarations, and have them declared in a new .cpp file. I'm using xcode, but I am open to any solutions. 回答1:

Automatically split (refactor) .h into header and implementation (h+cpp)

拜拜、爱过 提交于 2020-06-08 03:39:07
问题 When writing C++ code, I often start by writing full 'implementation' code in my header files, then later need to refactor the implementation into a .cpp file. This is great, but I find this process laborious, but otherwise pretty easy, so I wondered about whether is there any automated way to do this? Specifically, I want to convert all class and function definitions in the .h to declarations, and have them declared in a new .cpp file. I'm using xcode, but I am open to any solutions. 回答1:

R language aware code reformatting/refactoring tools?

三世轮回 提交于 2020-01-22 17:16:30
问题 Recently I've found myself working with R code that is all over the map in terms of coding style - multiple authors and individual authors who aren't rigorous about sticking to a single structure. There are certain tasks that I'd like to automate better than I currently do. I'm looking for a tool (or tools) that manage the following tasks - listed in increasing order of desire but also somewhat in increasing order of skepticism of existence. Basic formatting. Things like converting "if( foo )

Refactor Pro versus Visual Assist X for C++ Development [closed]

吃可爱长大的小学妹 提交于 2020-01-12 04:20:13
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . There are two major refactoring tools which can be installed for Visual Studio that provide C++ support. The full versions of both tools are $250, and they seem to offer similar functionality. They are: Developer Express' Refactor Pro + CodeRush Whole Tomato's Visual Assist X

Automated refactoring to add parameter names to method calls

心已入冬 提交于 2020-01-12 04:09:25
问题 I am in the middle of a big refactoring. I have dozens of methods, which are called via positional parameters. Now I would like to have them called via named parameters. The methods exist in several, non-inherited classes and have the same name and their signatures differ. Example: Definitions public class Foo { public static Foo Create(int count, string name) { ... } } public class Bar { public static Bar Create(string description, bool yesNo, float factor) { ... } } And the following calls

Simple Custom Refactoring in IntelliJ

坚强是说给别人听的谎言 提交于 2020-01-01 04:08:13
问题 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 violates LoD (Law of Demeter). class Bar { protected Foo foo; public Bar() { this.foo = new Foo(); } public Foo getFoo() { return foo; } } public static void main(String [] args) { Bar bar = new Bar(); String x = bar.getFoo().getX(); } I can refactor this code to use LoD in two steps. ⌥ ⌘ m bar.getFoo().getX() ->

Automatic code simplification via refactoring [closed]

自闭症网瘾萝莉.ら 提交于 2019-12-25 00:43:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . 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 comprehension)? Is there a tool to test the conciseness of c program?) but I'm not aware of any such program for Java. There are

Automatic refactoring of depending code after the fact

末鹿安然 提交于 2019-12-24 03:38:08
问题 Is there a way to record or describe a Java refactoring in a way that it can be automatically applied to a depending code base? My company works with two separate Java code bases, a platform and an add-on depending on the platform. (In fact, multiple add-ons for different customers.) The platform and the add-on are developed by different teams working on different release cycles: The add-on is updated some time after the platform is released. A refactoring applied to the platform is not

Automatic refactoring of depending code after the fact

为君一笑 提交于 2019-12-24 03:38:06
问题 Is there a way to record or describe a Java refactoring in a way that it can be automatically applied to a depending code base? My company works with two separate Java code bases, a platform and an add-on depending on the platform. (In fact, multiple add-ons for different customers.) The platform and the add-on are developed by different teams working on different release cycles: The add-on is updated some time after the platform is released. A refactoring applied to the platform is not

Which clang-tidy checks provide automated fixes?

被刻印的时光 ゝ 提交于 2019-12-22 08:20:02
问题 I'd like to find out which of the clang-tidy checks are possible to run with the -fix option, i.e. automatically generate fixed code. I know all the modernize-* checks can do this and some other checks can too (like google-readability-casting) but nowhere did I find a complete list. Is there a list somewhere? Or a method to find out other than reading the source of each and every check? 回答1: grep --include=\*.cpp -rc './' -e "FixItHint"|grep -v ':0$' > FixItChecks.txt I ran this grep command