{"action":"closed","issue":{"url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/173","labels_url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/173/labels{/name}","comments_url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/173/comments","events_url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/173/events","html_url":"https://github.com/phetsims/gravity-and-orbits/issues/173","id":115389631,"number":173,"title":"Code Review","user":{"login":"aaronsamuel137","id":3193912,"avatar_url":"https://avatars.githubusercontent.com/u/3193912?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronsamuel137","html_url":"https://github.com/aaronsamuel137","followers_url":"https://api.github.com/users/aaronsamuel137/followers","following_url":"https://api.github.com/users/aaronsamuel137/following{/other_user}","gists_url":"https://api.github.com/users/aaronsamuel137/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronsamuel137/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronsamuel137/subscriptions","organizations_url":"https://api.github.com/users/aaronsamuel137/orgs","repos_url":"https://api.github.com/users/aaronsamuel137/repos","events_url":"https://api.github.com/users/aaronsamuel137/events{/privacy}","received_events_url":"https://api.github.com/users/aaronsamuel137/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phetsims/gravity-and-orbits/labels/code%20review","name":"code review","color":"c7def8"}],"state":"closed","locked":false,"assignee":{"login":"aaronsamuel137","id":3193912,"avatar_url":"https://avatars.githubusercontent.com/u/3193912?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronsamuel137","html_url":"https://github.com/aaronsamuel137","followers_url":"https://api.github.com/users/aaronsamuel137/followers","following_url":"https://api.github.com/users/aaronsamuel137/following{/other_user}","gists_url":"https://api.github.com/users/aaronsamuel137/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronsamuel137/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronsamuel137/subscriptions","organizations_url":"https://api.github.com/users/aaronsamuel137/orgs","repos_url":"https://api.github.com/users/aaronsamuel137/repos","events_url":"https://api.github.com/users/aaronsamuel137/events{/privacy}","received_events_url":"https://api.github.com/users/aaronsamuel137/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-11-05T22:27:38Z","updated_at":"2015-11-19T17:07:36Z","closed_at":"2015-11-19T17:07:36Z","body":"**Build and Run Checks**\r\n\r\n- [x] Does the sim pass lint?\r\n- [x] Does the sim build without errors?\r\n- [x] Does the sim start up? (requirejs and built versions)\r\n- [x] Does the sim experience any assertion failures? (run with query parameter 'ea')\r\n- [x] Does the sim pass a scenery fuzzer test? (run with query parameter 'fuzzMouse')\r\n- [x] Are there any strings that are not being internationalized? (run with query parameter 'stringTest=x', you should see nothing but 'x' strings)\r\n- [x] Does the sim layout gracefully handle internationalized strings that are twice as long as the English strings? (run with query parameter 'stringTest=double')\r\n- [x] :x: Does the sim layout gracefully handle internationalized strings that are exceptionally long? (run with query parameter 'stringTest=long')\r\n- [x] Does the sim layout gracefully handle internationalized strings that are shorter than the English strings? (run with query parameter 'stringTest=X')\r\n\r\n**Repository structure**\r\n\r\n- [x] Are all required files and directories present?\r\n\r\n      For a sim repository named “my-repo”, the general structure should look like this (where assets/, audio/ or images/ may be omitted if the sim doesn’t have those types of assets).\r\n\r\n```js\r\n   my-repo/\r\n      assets/\r\n         my-repo-screenshot.png\r\n      audio/\r\n         license.json\r\n      doc/\r\n         model.md\r\n         implementation-notes.md\r\n      images/\r\n         license.json\r\n      js/\r\n         my-repo-config.js\r\n         my-repo-main.js\r\n      .gitignore\r\n      my-repo_en.html\r\n      my-repo-strings_en.json\r\n      Gruntfile.js\r\n      LICENSE\r\n      package.json\r\n      README.md\r\n```\r\n\r\n   For a common-code repository, the structure is similar, but some of the files and directories may not be present if the repo doesn’t have audio, images, strings, or a demo application.\r\n\r\n- [x] :x: Is the js/ directory properly structured?\r\n\r\n      All JavaScript source should be in the js/ directory. There should be a subdirectory for each screen (this also applies for single-screen sims).  For a multi-screen sim, code shared by 2 or more screens should be in a js/common/ subdirectory. Model and view code should be in model/ and view/ subdirectories for each screen and common/.  For example, for a sim with screens “Introduction” and “Custom”, the general directory structure should look like this:\r\n\r\n```js\r\n   my-repo/\r\n      js/\r\n         common/\r\n            model/\r\n            view/\r\n         custom\r\n            model/\r\n            view/\r\n         introduction\r\n            model/\r\n            view/\r\n         my-repo-config.js\r\n         my-repo-main.js\r\n ```\r\n\r\n- [x] :x: Is there a file in assets/ for every file in audio/ and images/?\r\n- [x] Are all license.json files populated? audio/license.json and images/license.json should enumerate all files in those directories. For the format of license.json files, go [here](https://github.com/phetsims/simula-rasa/blob/master/images/README.txt).\r\n- [x] Does the README.md format and content match PhET guidelines? Was it generated by `grunt generate-published-README` or `grunt generate-unpublished-README`?\r\n- [x] Does Gruntfile.js point to `chipper/js/grunt/Gruntfile.js`?\r\n- :x: Are dependencies in package.json the same as js/*-config.js? Do they match what is actually used by the sim? (ie, no missing dependencies, no unused dependencies)\r\n- [x] Is the LICENSE file correct? (Generally GPL v3 for sims, MIT for common code, but there are exceptions to this.)\r\n- [x] Does .gitignore match other repositories?\r\n- [x] Does *-main.js follow PhET conventions? Does it contain correct credits (options.credits passed to Sim constructor)?\r\n- [ ] :x: Is the format of assets/*-screenshot.png correct? (2048x1344, PNG, 32-bit color) Has the browser chrome been stripped off of the screenshot?\r\n- [x] Are there git repository branches that are no longer used and should be pruned?\r\n\r\n**Coding conventions**\r\n\r\n- [x] Does the code style meet PhET's code-style guidelines, as described in the [“Coding Style Guidelines” section of \"PhET Development Overview\"](https://docs.google.com/document/d/1odXkliRagq0zuf1_NdOtQ2BrkC9hwlISnPi2y-dKdrk/edit#heading=h.1oxr3ptyo50w)?\r\n- [x] Is the code formatted according to PhET conventions? See [phet-idea-code-style.xml](https://github.com/phetsims/joist/blob/master/util/phet-idea-codestyle.xml) for IntelliJ IDEA code style.\r\n\r\n**Documentation**\r\n\r\n- :x: Are documentation conventions followed, as described in the [“Coding Style Guidelines” section of the PhET Development Overview](https://docs.google.com/document/d/1odXkliRagq0zuf1_NdOtQ2BrkC9hwlISnPi2y-dKdrk/edit#heading=h.1oxr3ptyo50w)?\r\n- :x: Does model.md adequately describe the model, in terms appropriate for teachers?\r\n- [x] Does implementation-notes.md adequately describe the implementation, with an overview that will be useful to future maintainers?\r\n- [x] Are sim-specific query parameters (if any) identified and documented in one location?\r\n\r\n**Common Errors**\r\n\r\n- [x] Is `Math.round` used where `dot.Util.roundSymmetric` should be used?  Math.round does not treat positive and negative numbers symmetrically, see https://github.com/phetsims/dot/issues/35#issuecomment-113587879\r\n- [x] Is `toFixed` used where `dot.Util.toFixed` or `dot.Util.toFixedNumber` should be used? JavaScript's `toFixed` is notoriously buggy, behavior differs depending on browser, because the spec doesn't specify whether to round or floor.\r\n\r\n**Organization, Readability, Maintainability**\r\n\r\n- :x: Does the organization and structure of the code make sense? Do the model and view contain types that you would expect (or guess!) by looking at the sim? Do the names of things correspond to the names that you see in the user interface?\r\n- [x] Are appropriate design patterns used?\r\n- [x] Is inheritance used where appropriate? Does the type hierarchy make sense?\r\n- :x: Is there any unnecessary coupling? (e.g., by passing large objects to constructors, or exposing unnecessary properties/functions)\r\n- [x] Are the source files reasonable in size? Scrutinize large files with too many responsibilities - can responsibilities be broken into smaller delegates?\r\n- [x] Are any significant chunks of code duplicated? This will be checked manually as well as with https://github.com/danielstjules/jsinspect\r\n- [x] Is there anything that should be generalized and migrated to common code?\r\n\r\n**Performance, Usability**\r\n\r\n- [ ] Does the sim perform as desired across the range of supported platforms? (eg, not too slow on slow platforms, not too fast on fast platforms)\r\n- [x] If the sim uses WebGL, does it have a fallback? Does the fallback perform reasonably well? (run with query parameter 'webgl=false')\r\n- [ ] Are UI components sufficiently responsive? (especially continuous UI components, such as sliders)\r\n- :x: Are pointer areas optimized, especially for touch? (run with query parameter 'showPointerAreas')\r\n- [x] Do pointer areas overlap? (run with query parameter 'showPointerAreas')\r\n\r\n**Memory Leaks**\r\n\r\n- [x] Does a heap comparison using Chrome Developer Tools indicate a memory leak? (Describing this process is beyond the scope of this document.)\r\n- [x] Are there any leaks due to registration of AXON observers?\r\n\t- [ ] For each call to Property.link or PropertySet.link, is there a corresponding unlink, or documentation about why an unlink is unnecessary?\r\n\t- [ ] For each DerivedProperty or Multilink created, is there a corresponding detach, or documentation about why a detach is unnecessary?\r\n\t- [ ] For each common-code component (sun, scenery-phet, vegas, …) that opaquely registers an AXON observer, is there a call to that component’s dispose function, or documentation about why dispose is unnecessary?\r\n- [x] Are there any leaks due to registration of components with TANDEM? `tandem.addInstance` should be accompanied by `tandem.removeInstance` or documented why removeInstance is unnecessary.\r\n"}}