A Project for Chronicle 4 based on L2JServer.


    Improve code quality

    Share
    avatar
    Pandragon

    Posts : 19
    Join date : 2013-04-26

    Improve code quality

    Post  Pandragon on 24th January 2014, 20:01

    HOWTO: Indent code style and Code clean up.

    1.
    Delete javaTest.
    I believe that it is useless :/

    2.
    Gameserver (Java):
    Use the build-in code formater (Select GameServer Project -> Eclipse menu -> Source -> Clean up...).

    It will "prettify" the whole project code and make it more easy to read Smile
    Also it will drop about 2500 code warnings in Eclipse Wink

    3.
    Datapack (Python):
    If you don't have Python installed you will probably need to download it from http://www.python.org/download/
    I use version 3.3.3 x64.
    You will also need to have the PyDev Eclipse Plugin.
    Eclipse menu -> Help -> Install New Software... -> Add... -> http://pydev.org/updates

    Setup Pydev Code Formatter:
    Eclipse menu -> Window -> Preferences -> Pydev -> Editor -> Code Style -> Code Formatter -> Enable all tick boxes
    except the one that says "Use space before and after parenthesis?".

    Now you will be able to indent style any *.py file (unfortunately you will have to do it manually one file at the time).
    Open *.py file -> Eclipse menu -> Source -> Format Code

    *You may like to import the gameserver project to the Project References to avoid viewing Eclipse error warnings.

    4.
    Search for ways to improve code:
    You can install Eclipse plugins such as "CodePro AnalytiX" to analyse and improve the projects code.
    CodePro AnalytiX can be found at https://developers.google.com/java-dev-tools/download-codepro



    Hope that this post will be helpful for at least a few people.
    Cheers!
    avatar
    DnR
    Admin
    Admin

    Posts : 1027
    Join date : 2012-12-03

    Re: Improve code quality

    Post  DnR on 25th January 2014, 15:58

    That's a nice and useful guide.
    Thanks a lot. Smile

      Current date/time is 19th November 2017, 18:10