Java :: When To Consolidate Code Duplicates?
Sep 2, 2010
We're using a code static analysis tool (Sonar) to detect duplicate code on our project. It appears that there are a great many instances of duplicates in the code but most of them are less than 10 lines and occur only once. In the 'opinion' of the Stackoverflow community,Where should you draw the line at consolidating code duplications? For example should it be at >= 10 lines for individual duplicates or should you consider overall number of lines duplicated eg. consider > 10 duplicates that occur more than once.For context the programming languages I'm looking at are Java and ActionScript.
View 4 Replies
Similar Posts:
Aug 13, 2010
i am working on a flex+java combined project.My IDE and computer configuration is as follows:
[Code]...
When i make a small change in Flex code (eg, reposition of a button...anything), and run the project on server, it does make any change on output. Actually it depends on my luck... because it makes change in output randomly.what is is happening? tried rebuild, republish, clean , restart server, restarting the IDE, restarting the computer all available feature i could think. Also, i created a simple flex project on IDE and compiled it..... everything is compiled and displayed on output.
View 2 Replies
Dec 2, 2010
I am making a drag and drop game using AS2 in Flash CS5 where mc items are duplicated and enlarged from a menu and can be placed anywhere on the stage to create a custom robot. Each part (arms, head, feet, etc.) is it's own mc with unique instance names. I have the drag and drop part all figured out, and I even have the duplicateMovieClip part working...
HOWEVER... Whenever I move from the current frame that an object was duplicated in, to another frame and then back, the clips dissapear one by one if you try to create a new one. Each list of menu items are in their own frames (heads, torsos, arms, etc.). As the duplicates are made, they remain on stage no matter what frame you go to and can still be dagged around, which is good, but as I said previously, they dissappear when you create a new duplicate. Not all disappear at once, only older created duplicates disappear as you bring in new duplicates.
[Code]....
View 3 Replies
Jul 29, 2009
ActionScript Code:
/* Setup listener for each video/audio cue point ============ */
myListenerObject.cuePoint = function(evt:Object):Void {
if ((evt.info.time == cpTime[n]) || (evt.time == cpTime[n])) {
[Code]....
The code above does not work because of the if/else if statements. What I'm trying to accomplish is that I have a listener object that in one frame listens to an flv playback object, and in another frame listens to an mp3 file.
The listener code for both types are exactly the same, except that the flv listener uses the evt.info.time to check for cue points in the flv and the mp3 uses evt.time to listen for the cue points in the audio. Since I can't combine these with an OR operator, is there any other way to consolidate these two, or do I just need to keep two sets of the same listener code for each to refer to?
View 1 Replies
Aug 8, 2011
how do I consolidate adobe flash arrange window area so that I can make my time line small to be able to see the whole movie with keyframes how I want to see them. there are some times I have to scrool alway the way right, how do i avoide from doing this?
Something similar to how adobes audition stretches waves is this possible to do in your timeline?
View 6 Replies
Apr 8, 2011
I need to be able to transmit data from a Flash browser application to a PHP file on a web server, both securing and validating the data whilst and at the same time trying to prevent unauthorised creation of the message. (I want to try and ensure that the message comes from the application, not a user sending a message via another means).
In a C++ application I would Salt the data, and send the hash of the data along with it, and then validate the hash against the data to ensure integrity and source.However, in Flash (& Java), applications can be decompiled so that the source code is viewable. So if I used this method, someone could (relatively) easily find the salt, and then create a 'valid' message of their own to send outside of the application.
Is there any way I can 'hide' this salt code to help secure the transmission? Yes, I know there are code obfuscators, but they don't fully hide the code, just add another layer.Or is there another method entirely that could be used to transmit data and validate the source & content at the PHP end?
View 3 Replies
Jul 19, 2005
I need some help with this issue. I want to convert code written in Java to Actionscript code.
Or to find the way to call Java applets with actionscript.
View 4 Replies
Nov 24, 2010
I'm currently working on a Java/Flex project and I'm looking for a way to generate some parts of my Actionscript code from my Java files. One of the goal is to generate the AS valueObjects from the JAVA transferObject as well as some AS code to access the serverside function asynchronous.And other important point is that I want to be independent of some IDE. The code generation should run from Maven or Ant and take the Java source code as input.I looked a little bit around and found stuff like SpringROO, Groovy-GRAM, AST in eclipse,..
View 6 Replies
Jul 22, 2010
I used to write programs in the android sdk for google phone. One of the android developers guide that I read says that it is more efficient to declare a const public static const NO:String = "no";
var1 == NO;
var2 = NO;
than to do this
[code].....
View 1 Replies
Dec 10, 2009
I'm using Eclipse and I'm wondering what the best Eclipse/Java/Flexbuilder code review tool is. If it matters we're using SVN as our SCM. Here are the following I've come across: Jupiter - seems like it's been around for awhile it looks like there is only a single developer on the project and the documentation mentions rather old versions of Eclipse IBM's Collaborative Code Review plugin for eclipse - seems like its a proprietary code review tool so not sure it will be supported in the future (or have the ability for a community to assist in development). Eclipse COLA real-time shared editing - Not really a code review tool but more a way to view/edit files peer-to-peer style allowing code review like collaboration. Check out this video demonstration of COLA.
View 7 Replies
Apr 12, 2010
I'm working on a flash game written in pure actionscript 3.0 in Flex. I've just finished implementing replays for the game, but want to store the top 10 hiscores' replay data on my google-app-engine'd website. I'm using Java for the app-engine stuff in Eclipse in java but I have no idea how to deal with communicating to my java code from my actionscript code. I'll need to both read and write from actionscript -> java -> datastore. Does anyone have any experience with this?
For note, I'm horribly noob with anything to do with web development. I hear you can pass arguments to a URL when calling it, comparable to command-line arguments on a desktop executable and if so then sending all the data as a large string would be doable... The question then would be how to call a url from AS3 code with additional data and then how to catch that on the java side.
View 1 Replies
Feb 3, 2010
We just shipped Xuggler 3.4 this weekend which now has the ability to record and publish RTMP streams. That means you can now write Xuggler (a Java API for encoding and decoding video) programs that can publish to FMS or record from FMS.
We've worked closely with the FFmpeg team to get the core RTMP stack into that project, and have put together a tutorial on how to use FFmpeg to record or publish streams, including re-encoding media to H264/AAC while publishing.
View 7 Replies
Jan 11, 2010
I need to add this code of : add to favirote , to my page, I need to use this code espesifly,, this code is:
<a href="javascript:bookmarksite('mycompany titel', 'http://www.myweb.com')">Add to Favorites</a>
I need to put this code of link in flash , this is html code, so how I can add it to flash?
View 18 Replies
Jun 25, 2010
I am a .NET Developer, but the question I am having is not related to .NETPlease keep this in mind even if my question sounds very trivial.This is my question:We have an swf in the browser, which communicates with a java extensionIts done using Smartfox Server(Used for MMO apllications)From the swf we are grabbing a portion of the screen as "Byte Array" in action script(3).And in Java, we are calling a function that converts the ByteArray to Image and then saves it.ur Java developer is encountering the errorSo basically, what I would like to know is this:How to accept the object type Byte Array from ActionScript in Java?Whats Java object type that is mapped to Byte Array in ActionScript?The conversion part is easy, I dare say. code in the ActionScript Section
public function savePhoto(uName:String, ba:ByteArray, descr:String):void{
var obj:Object = {};
obj.arr = ba;
[code]....
View 3 Replies
Jul 16, 2010
I tried with flex and java in the backend. In this, I am able to upload files till 100 MB using remote object (blazeDs) where we will read the file as byte array and send it to the java method. If the file size exceeds after that, then I get the run time error in IE.
View 1 Replies
Oct 27, 2010
I could play MIDI file where "filename" is a String type with "asd.mid" value. However, I tried to sent AIR's nativeprocess command to Java, it shown "could not read" error.
[Code]...
View 1 Replies
Sep 15, 2011
Meaning specifically, what steps do you go through when creating a new application using these tools?
View 1 Replies
Aug 9, 2011
I have a client-server multigame suite for PC ("kind of" cross-platform using cygwin), which is developed in Java(game menus and database management), C++ (server side), and adobe Flash (game graphics & interaction).
I have never tried to develop for android, so i have no experience.I am thinking of migrating this suite to google TV. So i would like someone with android experience to give a clue on the following :
1) Is it going to be easy to migrate the Java application to an Android application?
2) What kind of Flash support does Android have? Can it load directly swf applications? Does it have to load swf's through browser?
3) Can i find any kind of performance indexes for google TV hardware?
View 1 Replies
Nov 13, 2011
I need to load somehow the html code of a webpage A into a javascript string of another webpage B, on a different host. I know this is impossible to do with javascript alone because of the same origin policy, and I know I could do it loading the page via php on my server and then send results back to the user's client but I wouldn't be able to handle so many requests, so I need it to be done directly by the user's browser. I can use nearly whatever browser scripting language/applet framework common enough to be installed on the majority of my users' computers, like flash and java.On example, what if I use flash or java to load the external html code and then call a javascript callback function providing the source? Could this work?
View 2 Replies
Mar 24, 2010
I am using Flex 3 and make a call through a RemoteObject to a Java 1.6 method and exposed with BlazeDS and Spring 2.5.5 Integration over a SecureAMFChannel. The ActionScript is as follows (this code is an example of the real thing which is on a separate dev network);
[Code]...
View 2 Replies
Jun 3, 2011
If one doesn't have the source code, the only to test is to send keystroke and mouse move so I found this product but it's not free and opensource price is not even known :([URL] Squish supports automating interactions and testing non-HTML/DOM elements, that is, native objects, which are embedded in a web page. This is done at a fairly abstract level, which means that mouse and text input can be recorded and replayed.
In addition it is possible to inspect embedded native objects with the Spy tool and to insert verifications for these native objects. All of a native object's public properties can be accessed in test scripts.
View 2 Replies
Aug 4, 2011
I'm building a Facebook multiplayer game where the client side is in FLEX and the server side is in Java and I wanted to know if there is a guide on how to build the server clients managing system. When I say server clients managing system, I mean a server which many clients will connect to and will be able to choose between tables to join and play or to create their own table, same way as in texas holdem poker.
View 1 Replies
Dec 7, 2010
Right away i just try to explain my problem: Using BlazeDS i got the following Javaclasses:
[Code]...
Then i got a Flex service class calling BlazeDS and executing the getCategories java method. Since Flash dosn't seem to understand typed arrays, the result from that method which i get back in flex is a simple array of untyped objects (the mapping dosn't seem to work here, even tought the class category exists in flex and has the same properties).
thats the first thing. but however, i'm converting the untyped objects manually into objects of the category.as class. the second thing is that categories have child-categories within the java object, which are also ArrayLists of the type category.java. the problem about that: my result event object only contains the first level of categories, looking into them the children are allways null. i dunno why they are empty, since they ARE part of the java object category.
and the third thing (the strangest by fast), you maybe noticed i named the properties of the category.java class strange, like idCat and nameTest instead of simply id and name. why that? because the property names of my flex result objects dont seem to change when i change the java objects properties names (result object properties are named "id" and "name" but the java class object properties are named "idCAT" and "nameTEST"). that it REALLY strange, since if i set the properties, like you see at nameTEST = "TESTNAME" it IS recogniced by flex, only the proertyNAMES dont seem to be recognized at all.
[Code]...
View 4 Replies
Apr 11, 2012
I am newer with flex technology.I am creating a chart using ant file & .mxml in eclipse my 'ant' file executes properly but it gives following error when i opens a .swf file which is created auomatically:
Flex Error #1002: Flash Player 9.0.115 and above is required to support signed RSLs. Problem occurred when trying to load the RSL
[Code]...
View 1 Replies
Mar 18, 2010
we are using BlazeDS as a proxy between Flex and Java. The approach is the same as in
[Code]...
View 3 Replies
Mar 23, 2010
I'm coding a web app in flex blazeds and Java. I installed the Eclipse plugins for using WTP mixed project. I'm using flex's server that uses an emulate of tomcat when i ran my flex service the web app got the datas, everythings is ok. the problem is when i copy the project with all files generated by flex in my tomcat or the blazeds's tomcat, it doesn't work, this is becasue i want to implement my app on a server the error is:[code]
i don't know why tomcat doesn't find the class of flex.messaging.endpoints.AMFEndpoint that is used for my-amf 'URL...'. all works well in the emulated server that flex has.
View 4 Replies
May 24, 2010
i hava two text boxs in flex.have to add two txt boxs values in back end java and have to return back to third text box in flex.
View 1 Replies
Jul 16, 2010
Assume I have the following java class public class Square {
[Code]...
Inside an actionscript class, using RemoteObject, I invoke the java method SquareDAO.findById(Long id) an I get an Object with the following: But I don't get the area. How can I invoke the method getArea() ?
View 1 Replies
Nov 11, 2010
I'm programming Rich web applications with Flex and Java on Flex Builder 3 using blazeDS and SharedObjects.Now I need that my program will use configuration file.so, I need that my Java class will read it at the first time but the default path of java to read and write files is c:program filesFlex Builder 3 and not my application directory inside the tomcat webapps directory How can I read the config file from the java class without write the path hardcoded in the java?
View 1 Replies
Oct 9, 2009
I have a movieclip in the library that I am exporting for actionscript. I duplicate the movieclip by adding a child for each occurance of a tag in actionscript. This works fine, but I can't figure out how to change the y postion of each new child to be 30 pixels below form the last child. Here is a snippet of the code where I am having the problem:
for (var i in xmlData.region){ for (var k in xmlData.region[i].regionInfo.payment);
var mcRI:regionInfo = new regionInfo(); this.addChild(mcRI); mcRI.txtPayment.htmlText = xmlData.region[i].regionInfo.payment[k].card; mcRI.y += 30; }
}
Instead of each new child's y position changing +30, every duplicate is on top of each other at +30.
View 3 Replies