klenwell information services : CodeSmells

Wiki source for CodeSmells


Show raw source

=====Code Smells=====
A few things that make me wrinkle my nose.

A more authoritative list: https://blog.codinghorror.com/code-smells/

==== Not Invented Here (NIH) Syndrome / Uncited Sources ====
Please do not reinvent the wheel or a natural language date parser: https://en.wikipedia.org/wiki/Not_invented_here#In_computing

==== String Concatenation ====
Interpolation not concatenation: https://github.com/rubocop-hq/ruby-style-guide#strings

==== Nested Conditionals ====
Use a guard clause: https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html

==== Magic Numbers ====
[[https://en.wikipedia.org/wiki/Magic_number_(programming)#Unnamed_numerical_constants https://en.wikipedia.org/wiki/Magic_number_(programming)]]

Use a constant or config setting.

==== Naming Tics ====
%%
# bad
admin_styles.scss
scripts-admin.js

# good
admin.scss
admin.js

# bad
public function handle_archiving_of_courses( ) {}

# good
public function archive_courses( ) {}
%%