Skip to content

Instantly share code, notes, and snippets.

@avisser
Last active September 18, 2017 14:16
Show Gist options
  • Save avisser/dd2789fba0297b07dde51ce42bd5af52 to your computer and use it in GitHub Desktop.
Save avisser/dd2789fba0297b07dde51ce42bd5af52 to your computer and use it in GitHub Desktop.

First crack at Clayton rules

  • disable "Require exception handling around DML statements"
    • can't set different policy for tests vs classes
  • disable "Require use of page messages in all pages"
    • This page doesn't present any messages to the user. Please include apex:pageMessages to display errors and messages in a user-friendly manner.

  • disable "Require compatibility with the Salesforce1 mobile app"
  • disable "Disallow use of dynamic SOQL"
    • fired for 'Select ' + fieldName not 'Where id = :id'
  • disable "Tag script is loading an external resource in a non-optimized way. Store the script in a static resource and use apex:includeScript to embed it in the page or component"
    • triggered for <script src="{!URLFOR($Resource.Framework__SLDS_BaseV2,'js/scripts.js')}" type="text/javascript"></script>
  • disable "Missing or incorrect sharing behavior on Form. Please update the sharing clause to with sharing."
    • triggered for public without sharing class Form

Warnings toned down

  • warning "Naming conventions for methods"
  • warning "Disallow methods with excessively long parameter lists"
  • warning "disallow large classes"
  • warning "nested if statements"
    • This statement is nested beyond 4 levels. Please refactor to reduce the number of branches and simplify the execution flow.

What's left

  • not much else
  • the warnings
  • "Test method testGetRouteWithMatchField doesn't perform any assertions"
  • DML in loops (1 occurence in LTE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment