The X3DOM module allows X3D developers and users to easily upload and interact with 3D models by adding an X3D Interactive Viewer format for File fields.

Users can select this format in a Content Type's Manage Display tab and a View's Formatters section.

This module includes the following:

  • X3D Interactive Viewer custom format
  • Style Viewer Width and Height
  • Built-in Controls including View All and Reset
  • Themable using CSS

Sandbox Project

https://www.drupal.org/sandbox/nih3dprint/2467593

Git Clone Command

git clone --branch 7.1-1.x http://git.drupal.org/sandbox/NIH3Dprint/2467593.git x3dom

Sample X3D File for Testing

Comments

NIH3Dprint’s picture

Issue summary: View changes
rgkimball’s picture

Looks like your repo and project page are all up to spec, nice work!

Automated Review

Firstly, I want to point out that pareview.sh identified several code standard issues with your module, which you should address so that other maintainers are willing review your module more thoroughly: http://pareview.sh/pareview/httpgitdrupalorgsandboxnih3dprint2467593git

I'll restrain from addressing some of the syntactic issues that are covered by the review linked to above in my own review, but following these coding standards is important to ensure that your code is easy to read and maintain.

Also, as far as standard folder structure, typically your js and css files should be found in x3dom/js/ and x3dom/css/ folders respectively. This promotes readability and maintainability for future users and contributors, and ensures that all Drupal modules share similar structure.

Code Review

The first thing that I noticed was that you've included the source code for the javascript library directly within your module. You might want to explore the possibility of using the Libraries API instead, which tends to make it easier to update source code as updates are released. Your module should not be dependent on a specific version of the library unless there is clear justification for it.

In your hook_field_formatter_view(), you've included lots of inline javascript as well (presumably to integrate the aforementioned library). This might be a good use case for including your own javascript file, so that you can run your script as an IIFE and prevent potential collisions. At line 107, you're using the $ alias for jQuery, which is not recommended per Drupal's Javascript coding standards.

Finally, at line 150, you should be able to use theme_html_tag($variables) to construct your X3D element with any applicable attributes. Alternatively, consider building a template of your own with hook_theme() if you'd prefer to capture this in a separate file (which is probably the better option for this use case anyway).

All things considered, this is a fairly simple and functional module. Coding standards aside, I see no apparent security vulnerabilities, and the module is certainly independent from crossover with existing contrib modules.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

vineethaw’s picture

Hello,

You need to use use lowercase html tags to comply with XHTML in module file. Also you can implement hook_help to give information about your module.
Also I couldn't x3dom-full.js & x3dom.css in the module folder.

rutel95’s picture

There are few errors are still in the code.
FILE: /var/www/drupal-7-pareview/pareview_temp/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 15 WARNINGS AFFECTING 15 LINES
----------------------------------------------------------------------
6 | WARNING | Line exceeds 80 characters; contains 98 characters
15 | WARNING | Line exceeds 80 characters; contains 83 characters
16 | WARNING | Line exceeds 80 characters; contains 99 characters
20 | WARNING | Line exceeds 80 characters; contains 96 characters
22 | WARNING | Line exceeds 80 characters; contains 118 characters
29 | WARNING | Line exceeds 80 characters; contains 94 characters
31 | WARNING | Line exceeds 80 characters; contains 103 characters
33 | WARNING | Line exceeds 80 characters; contains 81 characters
41 | WARNING | Line exceeds 80 characters; contains 103 characters
54 | WARNING | Line exceeds 80 characters; contains 92 characters
59 | WARNING | Line exceeds 80 characters; contains 86 characters
67 | WARNING | Line exceeds 80 characters; contains 105 characters
76 | WARNING | Line exceeds 80 characters; contains 113 characters
86 | WARNING | Line exceeds 80 characters; contains 83 characters
95 | WARNING | Line exceeds 80 characters; contains 173 characters
----------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/x3dom.module
---------------------------------------------------------------------------
FOUND 9 ERRORS AND 2 WARNINGS AFFECTING 11 LINES
---------------------------------------------------------------------------
7 | ERROR | [x] Additional blank lines found at end of doc comment
92 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
96 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
98 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
100 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
101 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
102 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
111 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: )
119 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: )
122 | ERROR | [x] Expected 1 space after closing parenthesis; found ""
125 | ERROR | [ ] Concatenating translatable strings is not allowed,
| | use placeholders instead and only one string literal
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

rutel95’s picture

Status: Needs review » Needs work
rutel95’s picture

Automated Review

Please fix http://pareview.sh/pareview/httpgitdrupalorgsandboxnih3dprint2467593git

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
No: Does not followthe guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. (*) In your x3dom_field_formatter_view():
    in line 124 html code it would be good to move into a template
    in line 83 js move into file
    in line 122 condition not write standards please see https://www.drupal.org/coding-standards#controlstruct
  2. (+) Release blocker
  3. Just a recommendation
  4. ...]

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.