Skip to content

Instantly share code, notes, and snippets.

View timcunningham's full-sized avatar

Tim Cunningham timcunningham

View GitHub Profile

Response to Cameron's Refactoring Feedback

Introduction

This document addresses Cameron's feedback on the refactoring work documented in REFACTORING_SUMMARY.md. I'll be honest where I was wrong and defend where I was right.


1. Validator.cfc - XSS protection via sanitization

Verdict: Cameron is RIGHT. I was wrong.

ColdFusion Clean Code Refactoring - Completion Summary

Date: 2025-11-20

Project: De Smet Farm Mutual Insurance Payment System


🎉 MAJOR ACCOMPLISHMENTS

Security Vulnerabilities Eliminated ✅

# ColdFusion Project
This is a ColdFusion (CFML) application. Use modern CFML practices, prioritize security, and optimize performance.
## Clean Code Principles (Bob Martin)
These principles apply to ALL code you write, regardless of language:
### Meaningful Names
- **Use intention-revealing names**: Names should answer why it exists, what it does, and how it's used
## Clean Code Principles (Bob Martin)
These principles apply to ALL code you write, regardless of language:
### Meaningful Names
- **Use intention-revealing names**: Names should answer why it exists, what it does, and how it's used
- **Avoid disinformation**: Don't use names that obscure meaning (e.g., `accountList` when it's not actually a list)
- **Make meaningful distinctions**: Don't use number-series naming (`a1`, `a2`) or noise words (`ProductInfo` vs `ProductData`)
- **Use pronounceable names**: If you can't pronounce it, you can't discuss it intelligently
- **Use searchable names**: Single-letter names and numeric constants are hard to locate across a codebase
@timcunningham
timcunningham / gist:115ac64c8e3f04f15b191016c0eb0b52
Last active November 4, 2021 17:12
Converting IP Addresses To Integer Values With ColdFusion
<!--- Set the IP address. --->
<cfset ipAddress = "10.150.160.228" />
<!--- Break the IP address into numeric units. --->
<cfset ipParts = listToArray( ipAddress, "." ) />
<!--- Create a running total for our numeric IP equivalent. --->
<cfset ipNumber = 0 />
<!---
@timcunningham
timcunningham / docfetcher.cfm
Last active December 11, 2020 20:06
docfetcher
<cfscript>
param name="url.document" default="";
param name="statusText" default="";
// Get document path. Replace backslashes in url.document with forward slashes for OS consistency
documentPath = settings.batchDirectory & "/" & url.document.replace("\", "/", "all");
// Respond with 404 if the document does not exist on disk
if (! url.document.len() || ! fileExists(documentPath)) {
response.statusCode = 404;
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
4077 1431 1511 4710
0225
350
zip 31008
$name = $args[0] #-- Name and folder name of project
$site =$args[1] #-- site name like www.foo.com
$config = $args[2] #-- cfconfig json file to setup datasources etc..
if (!(Get-Module -ListAvailable -Name IISManager)) {
Install-Module -Name IISManager -Confirm:$False -Force
}
if (!(Get-Module -ListAvailable -Name Hosts)) {
Install-Module -Name Hosts -Confirm:$False -Force
}
$Project = $args[0]
$repo = "IDMI/$Project.git"
$fullPath = "C:\Domains\$Project"
$getLocation = Get-Location
if (-not (Test-Path -Path $fullPath) ) {
Write-Output "Clone $repo to $fullPath"
git clone [email protected]:$repo $fullPath
cd $fullpath
git fetch integration