Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: A Real POS Report

    CodeSOD: A Real POS Report

    June 9, 2025

    Eddie‘s company hired a Highly Paid Consultant to help them retool their systems for a major upgrade. Of course, the HPC needed more and more time, and the project ran later and later and ended up wildly over budget, so the HPC had to be released, and Eddie inherited the code.

    What followed was a massive crunch to try and hit absolutely hard delivery dates. Management didn’t want their team “rewriting” the expensive code they’d already paid for, they just wanted “quick fixes” to get it live. Obviously, the HPC’s code must be better than theirs, right?

    After release, a problem appeared in one of their sales related reports. The point-of-sale report was meant to deliver a report about which items were available at any given retail outlet, in addition to sales figures. Because their business dealt in a high volume of seasonal items, every quarter the list of items was expected to change regularly.

    The users weren’t seeing the new items appear in the report. This didn’t make very much sense- it was a report. The data was in the database. The report was driven by a view, also in the database, which clearly was returning the correct values? So the bug must be in the code which generated the report…

    If POSItemDesc = "Large Sign" Then
            grdResults.Columns.FromKey("FColumn12").Header.Caption = "Large Sign"
    End If
    If POSItemDesc = "Small Sign" Then
            grdResults.Columns.FromKey("FColumn12").Header.Caption = "Small Sign"
    End If
    If POSItemDesc = "2x2 Hanging Sign" Then
            grdResults.Columns.FromKey("FColumn12").Header.Caption = "2x2 Hanging Sign"
    End If
    If POSItemDesc = "1x1 Sign" Then
            grdResults.Columns.FromKey("FColumn12").Header.Caption = "1x1 Sign"
    End If
    '.........Snipping more of these........
    If POSItemDesc = "Light Thief" Then
            grdResults.Columns.FromKey("FColumn12").Header.Caption = "Light Thief"
    End If
    If POSItemDesc = "Door Strike" Then
            grdResults.Columns.FromKey("FColumn12").Header.Caption = "Door Strike"
    End If
    

    First, it’s worth noting that inside of the results grid display item, the HPC named the field FColumn12, which is such a wonderfully self documenting name, I’m surprised we aren’t all using that everywhere. But the more obvious problem is that the list of possible items is hard-coded into the report; items which don’t fit one of these if statements don’t get displayed.

    At no point, did the person writing this see the pattern of “I check if a field equals a string, and then set another field equal to that string,” and say, “maybe there’s a better way?” At no point, in the testing process, did anyone try this report with a new item?

    It was easy enough for Eddie to change the name of the column in the results grid, and replace all this code with a simpler: grdResults.Columns.FromKey("POSItem").Header.Caption = POSItemDesc, which also had the benefit of actually working, but we’re all left puzzling over why this happened in the first place. It’s not like the HPC was getting paid per line of code. Right? Right?

    Of course not- no HPC would willingly be paid based on any metric that has an objective standard, even if the metric is dumb.

    [Advertisement]
    ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleTactics – football lineup builder
    Next Article Fine del Supporto per Linux Mint 20.x

    Related Posts

    News & Updates

    The best CRM software with email marketing in 2025: Expert tested and reviewed

    July 22, 2025
    News & Updates

    This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

    July 22, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-4532 – Shanghai Bairui Information Technology SunloginClient DLL Search Path Vulnerability (Uncontrolled Search Path)

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-5833 – Pioneer DMH-WT7600NEX Root Filesystem Authentication Bypass

    Common Vulnerabilities and Exposures (CVEs)

    Sensitive Gangsta Merch

    Web Development

    Elevate business productivity with Amazon Q and Amazon Connect

    Machine Learning

    Highlights

    CVE-2025-6271 – Swftools wav2swf Out-of-Bounds Read Vulnerability

    June 19, 2025

    CVE ID : CVE-2025-6271

    Published : June 19, 2025, 6:15 p.m. | 4 hours, 14 minutes ago

    Description : A vulnerability, which was classified as problematic, was found in swftools up to 0.9.2. This affects the function wav_convert2mono in the library lib/wav.c of the component wav2swf. The manipulation leads to out-of-bounds read. The attack needs to be approached locally. The exploit has been disclosed to the public and may be used.

    Severity: 3.3 | LOW

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    Play Fortnite? You can claim part of Epic’s $245 million settlement payout – for one more week

    July 1, 2025

    ⚡ Weekly Recap: Chrome 0-Day, Data Wipers, Misused Tools and Zero-Click iPhone Attacks

    June 17, 2025

    GhostContainer Malware Hacking Exchange Servers in the Wild Using N-day Vulnerability

    July 17, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.