code-cleanup

What is the best way to remove dead code from your application? [closed]

拜拜、爱过 提交于 2019-12-11 05:24:02
问题 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 last month . I often feel that after iterating over my code for a number of times I am left with functions or classes or other lines of code in general which made sense in the previous revision but are not very useful for the new revision. I know that a profiler can tell you what part of

Resharper code cleanup not available on Unityconfig.cs

随声附和 提交于 2019-12-10 20:38:54
问题 I'm using ReSharper 2016.3.2 . It works nicely, but I bumped into a weird issue, the code cleanup feature is not available for UnityConfig.cs . The Refactor context menu is disabled, the hotkey for cleanup shows the following message: The Key combination (Ctrl+E, Ctrl+C) is bound to command (ReSharper_CleanupCode) which is not currently available. I looked into ReSharper settings, the Elements to skip blocks are empty, where they're present (Search & navigation, Code inspection settings). If

HTML5 Audio Player: How to select by HTML elements instead of div ID's?

泄露秘密 提交于 2019-12-10 11:58:38
问题 Making an html5 player, I'm moving away "from divs with id's" towards "simple html elements". Old Situation (works) <audio src="track1.mp3" id="audio"></audio> <controls> <play id="play" style="display:none">PLAY</button> <pause id="pause" style="display:none">PAUSE</button> <div id="progress"><div id="bar"></div></div> </controls> Javascript gets elements by divs with an id var myAudio = document.getElementById('audio'); var play = document.getElementById('play'); var pause = document

Method (e.g. via bash script) to turn php array indexes currently using constants into array indexes using single quoted strings?

。_饼干妹妹 提交于 2019-12-08 08:08:22
问题 I have a huge pile of php scripts with lots of constants being used in place of proper single-quoted array strings. For example: $row_rsCatalogsItems[Name] (bad) instead of $row_rsCatalogsItems['Name'] (good) How would I create a script (bash, php, whatever is most usable) that I can run on scripts to convert them to the more sensible method? Ideally it wouldn't just match the [something], but also the $variable_name[someIndex]. I'm actually wondering whether it's even viable considering the

Regex to match any “UNUSED” rules in CSS (class, id, etc)

那年仲夏 提交于 2019-12-08 01:57:12
问题 I have a huge CSS file which I want to trim down to only used css rules. I did this by using CSS Usage Add-on for Firebug. It adds an "UNUSED" label to every rule not being used. Now I want to get rid of these. The CSS code looks like this: body { line-height: 1; text-align: left; } UNUSED.multiple-list { font-weight: bold; line-height: 1.4; list-style: disc; margin-left: 20px } UNUSEDmenu, UNUSEDol, ul { list-style: none } UNUSEDblockquote, UNUSEDq { quotes: none } I tried to find my own

Track files changes done by eclipse cleanup programmatically

孤人 提交于 2019-12-06 15:06:26
I have written one eclipse osgi plugin that runs cleanup and formatting actions on java files present in eclipse project. Some thing like: Run batch file that has eclipse command It open's eclipse editor Loads eclipse project passed as parameter in batch command Run cleanup and formatting actions Closes eclipse Now my problem is I need to track the files that has been changed by this action. I am performing cleanup changes using cleanUpsAction that runs as thread over multiple files and forks further. It returns void. There is IResourceChangeListener which I tried as well but I am not able to

Xcode Project broken after renaming and rebuilding (App cleaned, and ran at the same time, and schemes broke)

£可爱£侵袭症+ 提交于 2019-12-06 06:37:58
问题 I was renaming my app from "App's Name?" to "Apps Name", removing the question mark and apostrophe, to prevent the error "A signed resource has already been added, modified, or deleted". However, at one point, the project seemed to clean itself and try building/running at the same time, which caused the build to fail. So I closed and reopened Xcode, and the project is now broken. I can't save it, or build or clean it (all these options are greyed out in the menu). It shows a wheel next to my

Regex to match any “UNUSED” rules in CSS (class, id, etc)

别说谁变了你拦得住时间么 提交于 2019-12-06 05:17:02
I have a huge CSS file which I want to trim down to only used css rules. I did this by using CSS Usage Add-on for Firebug. It adds an "UNUSED" label to every rule not being used. Now I want to get rid of these. The CSS code looks like this: body { line-height: 1; text-align: left; } UNUSED.multiple-list { font-weight: bold; line-height: 1.4; list-style: disc; margin-left: 20px } UNUSEDmenu, UNUSEDol, ul { list-style: none } UNUSEDblockquote, UNUSEDq { quotes: none } I tried to find my own Regex using RegExr online service but I was only able to select the part in between the curly braces. My

Optimization- Is there any way to find and remove unused CSS and Javascript common to all html pages? [closed]

安稳与你 提交于 2019-12-03 14:38:29
问题 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 4 years ago . My website has many webpages and I am trying to clean up my stylesheets and scripts. About 10% or more of each js/css are not being used by any of the html pages in my website. What I need is to remove the common unused and redundant css and js. I did a bit of research and found this. But it is not free. NOTE:

Optimization- Is there any way to find and remove unused CSS and Javascript common to all html pages? [closed]

一世执手 提交于 2019-12-03 10:33:34
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. My website has many webpages and I am trying to clean up my stylesheets and scripts. About 10% or more of each js/css are not being used by any of the html pages in my website. What I need is to remove the common unused and redundant css and js. I did a bit of research and found this . But it is not free. NOTE: Some of the js/css are being called by more than one html page and still there is a portion of each js/css not