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

      The Ultimate Guide to Node.js Development Pricing for Enterprises

      July 29, 2025

      Stack Overflow: Developers’ trust in AI outputs is worsening year over year

      July 29, 2025

      Web Components: Working With Shadow DOM

      July 28, 2025

      Google’s new Opal tool allows users to create mini AI apps with no coding required

      July 28, 2025

      I replaced my Samsung OLED TV with this Sony Mini LED model for a week – and didn’t regret it

      July 29, 2025

      I tested the most popular robot mower on the market – and it was a $5,000 crash out

      July 29, 2025

      5 gadgets and accessories that leveled up my gaming setup (including a surprise console)

      July 29, 2025

      Why I’m patiently waiting for the Samsung Z Fold 8 next year (even though the foldable is already great)

      July 29, 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

      Performance Analysis with Laravel’s Measurement Tools

      July 29, 2025
      Recent

      Performance Analysis with Laravel’s Measurement Tools

      July 29, 2025

      Memoization and Function Caching with this PHP Package

      July 29, 2025

      Laracon US 2025 Livestream

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

      Microsoft mysteriously offered a Windows 11 upgrade to this unsupported Windows 10 PC — despite it failing to meet the “non-negotiable” TPM 2.0 requirement

      July 29, 2025
      Recent

      Microsoft mysteriously offered a Windows 11 upgrade to this unsupported Windows 10 PC — despite it failing to meet the “non-negotiable” TPM 2.0 requirement

      July 29, 2025

      With Windows 10’s fast-approaching demise, this Linux migration tool could let you ditch Microsoft’s ecosystem with your data and apps intact — but it’s limited to one distro

      July 29, 2025

      Windows 10 is 10 years old today — let’s look back at 10 controversial and defining moments in its history

      July 29, 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

    I replaced my Samsung OLED TV with this Sony Mini LED model for a week – and didn’t regret it

    July 29, 2025
    News & Updates

    I tested the most popular robot mower on the market – and it was a $5,000 crash out

    July 29, 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

    Phone theft is on the rise – 7 ways to protect your device before it’s too late

    News & Updates

    Node.js 24 Is Here: What You Need to Know

    Development

    CVE-2025-53499 – Wikimedia Foundation Mediawiki AbuseFilter Extension Missing Authorization Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    The Ultimate Guide to Demo Websites for Selenium Automation Testing

    Development

    Highlights

    CVE-2025-44003 – Gallagher T-Series Reader Resource Exhaustion Denial of Service

    July 10, 2025

    CVE ID : CVE-2025-44003

    Published : July 10, 2025, 3:15 a.m. | 49 minutes ago

    Description : Missing Release of Resource after Effective Lifetime (CWE-772) in the Gallagher T-Series Reader allows an attacker with physical access to the reader to perform a limited denial of service when 125 kHz Card Technology is enabled.

    This issue affects T-Series Readers: 9.20 prior to vCR9.20.250213a (distributed in 9.20.1827 (MR2)), 9.10 prior to vCR9.10.250213a (distributed in 9.10.2692(MR5)), 9.00 prior to vCR9.00.250619a (distributed in  vEL9.00.3371 (MR7)),  all versions of 8.90 and prior.

    Severity: 4.3 | MEDIUM

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

    CVE-2025-40777 – ” BIND Named CNAME Chain Abort Vulnerability”

    July 16, 2025

    How to avoid that your post about AI helps the hype

    July 21, 2025

    CVE-2025-5419 – Google Chrome Heap Corruption Vulnerability

    June 2, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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