Release Assembly - Output Builder Code Enhancement

Register
Submit a solution
The challenge is finished.

Challenge Overview

 

Project Overview

The CPQ application has been developed to provide sales users at a outdoor advertising media company the ability to create advertising campaigns plans and generate dynamic proposals for their customers. The solution has been built on the Salesforce platform leveraging multiple integrations to obtain availability data, OOH ratings and inventory maps as well as leverages Heroku to create the proposal outputs - which is referred to as the "Output Builder".

Competition Task Overview

This project is written by client and most development is completed.

Our task is improve the main code, test code and document quality.

The existing code includes some tests and we need to complete the tests to make sure all public/protected classes/methods have the tests.

Note: please don't break the functions or change the design.

Main Code: https://github.com/cloudspokes/pdfcombinercco

Two Dependency Components: 

https://github.com/bnepani/pdfcombinercco/tree/master/PDFCombiner

https://github.com/bnepani/pdfcombinercco/tree/master/ReportGenerator

You can find how to deploy and use this project here: https://github.com/cloudspokes/pdfcombinercco/blob/master/OutputBuilder%20Detailed%20Design%20Document.pdf

Note: don't change the folder structure or build script for main code. The deployment steps must be same to the existing code. But it's allowed to introduce new script to run code style checker and unit tests. (don't put them in one script).

Known issues need to be fixed (our suggestions but not limited to these issues, you need to check if it has other issues or doesn't follow best practise).

  1. Use Logging instead of System.out.println
  2. Exception Should be handled properly instead of just print the stack trace 
  3. Space should be used instead of tab for indent
  4. Define Enum File Type instead of hard code the suffix (e.g. .xml, .pdf, .xls) in Java Code
  5. Avoid too long line (exceed 120 chars in topcoder standard)
  6. Provide Javadoc for all classes/variables/methods.
  7. app\controllers\Application.java line 203
    workers\pdf\WorkerProcess.java line 306
    Variable Url is too similar to the input parameter named url what can later easily lead to errors in case wrong letter case is used. Suggested to change the name of the Url variable to more descriptive and different from url.
  8. \modules\pdfworker\src\main\java\com\appirio\workers\pdf\WorkerProcess.java line 178, 179

    Map readValue = mapper.readValue(result, Map.class);
    Map<String, String> resultJson = readValue;

    actual: references to generic type is not parametrized.
    expected: Map is a raw type.References to generic type should be parametrized.

  9. \modules\pdfworker\src\main\java\com\appirio\workers\pdf\WorkerProcess.java line 67

    String uniqueId = String.valueOf(Calendar.getInstance().getTimeInMillis());

    actual: Calendar.getInstance().getTimeInMillis() is set as parameter.
    expected: Calendar.getInstance().getTimeInMillis() must be declared as global variable and in method String.valueOf() must be only access only.

  10. Magic Code should be avoided. E.g. change 1024, 4096 to constant.

  11. Use following copyright:

//~~~~~~~~~~~~~~~~~~~~~~~~~ 

// (c) 2013 Appirio, Inc.

//~~~~~~~~~~~~~~~~~~~~~~~~~

// CPQ_Util : Utility Class used for all common methods.

//

// 17 Jan 2013       <<TC User Name>>        Build v. x.xx

// 23 Jan 2013       <<TC User Name>>        Build v. x.xx

//

~~~~~~~~~~~~~~~~~~~~~~~~~

Testing

It must works same as the original code.

Automatic (e.g. checkstyle) and manual verification on the code and function are needed.

Technology Overview

  • Java


Final Submission Guidelines

Submission Deliverables

  • All new / changed files should be submitted.
  • Deployment Guide
  • Any other files (e.g. configuration file) for unit tests

Review style

Final Review

Community Review Board

Approval

User Sign-Off

Challenge links

ID: 30035986