8 votes
Accepted

Voting plugin for an IRC bot

Grumble, grumble. Browser tab crashed and SO didn't save my draft apparently. I'll try to recreate everything I remember writing: First off, your question is fantastically written. Often one of the ...
Bailey Parker's user avatar
6 votes
Accepted

Calculating areas of map features

You can greatly simplify this code by introducing a helper function that calculates the area_score for one of the categories. Let's take the first category as an ...
Graipher's user avatar
  • 40.9k
6 votes
Accepted

Update GIS Project by matching files from directory with files already loaded and apply relevant symbology

Wow. That's a lot of code. The very first thing that needs to be done with it is modularization. You need to structure your code such that named functions and/or classes encapsulate shared ...
Dan Oberlam's user avatar
  • 7,804
6 votes
Accepted

NRPE script for monitoring load average

This looks pretty good. Some suggestions: [[ is preferred over [ in Bash. This script could benefit from ...
l0b0's user avatar
  • 8,927
5 votes

Sublime Text plugin to modify text before it's pasted

If your intention is to escape certain characters by prefixing them with backslashes, you would be better off with a function that performs that specific task, rather than a generalized function that ...
200_success's user avatar
4 votes
Accepted

Reduce list manipulation for QGIS layer tree

Your lists manipulations are indeed messy. It seems like you are trying to perform multiple things at once and thus you end up mixing variables that serve different purposes into the same loops. ...
301_Moved_Permanently's user avatar
3 votes
Accepted

Internet Relay Chat bot core with plugins system

I have the following points to make on the code: - No logging - No external config file for the settings (Open/Close Principal violation) - Creating resources in the init instead of in a separate ...
C. Harley's user avatar
  • 1,523
3 votes
Accepted

Python toolbox for OpenStreetMap data

Some minor stuff: I don't see where self.tools is used after initialization - can it be deleted? If you need to keep it, does it need to change? If it doesn't ...
Reinderien's user avatar
3 votes
Accepted

Nagios plugin webdav check 2

Thanks for incorporating the various suggestions and posting a new code review. This is looking really excellent. Some nits and answers to your concerns: creating a function for ...
chicks's user avatar
  • 2,875
3 votes
Accepted

Handlers for checkboxes to select various map features

you only have a difference in two places: query and attribute of dockwidget you are going to check against. so you can pass them as parameters to your score function. ...
Alex's user avatar
  • 1,622
3 votes

Popup jQuery plugin

Mutually exclusive functions if (popup.css('display') === 'block') { shortPopup(); longPopup(); } I don't like that you have two mutually exclusive functions....
Sumurai8's user avatar
  • 2,595
3 votes
Accepted

Documentation for a Minecraft server plugin

First of all, there is a dinstinction between comments and documentation. Documentation (Javadoc) defines the contract of what it documents. The Javadoc on a class, for example, describes what the ...
Tunaki's user avatar
  • 9,243
3 votes
Accepted

Integrating the Ace embeddable code editor for editing HTML, CSS, and JavaScript

Isolate what varies, and abstract out what's repeated: ...
Jonah's user avatar
  • 4,340
3 votes
Accepted

Compile-time plugin system

Interface class IPluginRegistrar { public: virtual IPlugin* GetPlugin() = 0; }; Is GetPlugin() ever going to return a ...
Martin York's user avatar
3 votes

NRPE script for monitoring load average

I’d agree with all of l0b0’s answer – including the suggestion of using grep to process /proc/cpuinfo. An alternate way to count ...
Anthony Geoghegan's user avatar
3 votes
Accepted

Vim plugin for easy window navigation

As requested on vi.SE, here is my little view. First, I see a great quality in most patterns you have used: autoload plugin, plug-mappings, and so on. Good work! If I really had to nit-pick, it would ...
Luc Hermitte's user avatar
3 votes
Accepted

Jekyll plugin which bundles files into a zip archive

Consistency Sometimes you use snake_case, sometimes you use camelCase for methods and local variables. Sometime you use single-...
Jörg W Mittag's user avatar
3 votes

Jekyll plugin which bundles files into a zip archive

Jörg already provided some good suggestions. The only thing I would add is that your render function contains all of your business logic and is quite difficult to ...
Christian Bruckmayer's user avatar
3 votes
Accepted

An extended JavaScript plugin for rendering radial pie charts

First off, that isn't "XML". Those are custom HTML elements. Most of the code in typesetSinglePieChart belongs in the constructor. You don't need the ...
RoToRa's user avatar
  • 11k
2 votes

Nagios plugin webdav check 2

Instead of this: function _curl { curl --fail -u $USERNAME:$PASSWORD "$@" } The recommended writing style is this for functions: ...
janos's user avatar
  • 111k
2 votes

Handlers for checkboxes to select various map features

You could exploit the fact that in Python functions are first-class objects. What this means is that you can return a function from a function. This can be used to define a function factory, a factory ...
Graipher's user avatar
  • 40.9k
2 votes
Accepted

WordPress Settings Plugin security

A cursory glance suggests the main issue is a lack of escaping on the HTML esc_attr esc_html ...
Tom J Nowell's user avatar
2 votes
Accepted

Setting QProgressBar values based on selection

One idea would be to gather all your techs in a queue and iterate over that, updating the progress as you go. Since my Python is rather Rust-y (I'm sorry for that pun), here's some pseudocode: ...
Phil Kiener's user avatar
2 votes

AutoSuggest: Better way to implement focus after inserting a snippet

I do feel that negative numbers seems a bit backwards compared to most other libraries I have used. I am not sure what all would be involved with reworking this code to utilize positive numbers but it ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes

basic jQuery plugin template

In general the template looks like a good start. I noticed that the code appears to resemble the format advised in PHP-Fig's PSR-2, namely "The opening brace MUST go on its own line"1 for functions ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes

basic jQuery plugin template

From a short review; Please follow the lowerCamelCase naming convention, user_settings -> userSettings In production code, ...
konijn's user avatar
  • 33.2k
2 votes
Accepted

NRPE script for monitoring memory usage

I don't understand why it should be a warning to have over 80% of the system RAM available. If anything needs a warning, it should be having under 20% of RAM available, right? Reading each line into ...
200_success's user avatar
2 votes

A JavaScript plugin for rendering radial pie charts

Bearing in mind that this code has successor code in An extended JavaScript plugin for rendering radial pie charts, which appears to have been modified significantly, I still noticed review aspects. D....
Sᴀᴍ Onᴇᴌᴀ's user avatar
1 vote

Dynamically Generating XML Deserialization Classes / Code: Part I, Reading

Program to Interfaces, not Implementations The code base heavily depends on ArrayList. For example in Reading ...
Roman's user avatar
  • 2,813
1 vote

jQuery plugin to load a full-page view window

Feedback Overall the code seems to be architected acceptably (though see the first review point below about the DOM-ready code). Some of the HTML generation seems complex - perhaps using a template ...
Sᴀᴍ Onᴇᴌᴀ's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible