GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — configparser.RawConfigParser._read is unmanageably complex · Issue #117348 · python/cpython

configparser.RawConfigParser._read is unmanageably complex #117348

New issue
Copy link
New issue
Copy link
Closed
Closed
configparser.RawConfigParser._read is unmanageably complex#117348
Copy link
Assignees
jaraco
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-featureA feature request or enhancementA feature request or enhancement

Description

@jaraco
jaraco
opened on Mar 28, 2024
Issue body actions

From the review:

This function is already unmanageably complex (and complexity checks disabled in the backport). Adding this single boolean parameter has expanded this function from ~120 lines to almost 160 and increases the mccabe cyclometric complexity of this function from 25 to 31 (where a target complexity is <10).

cpython main @ pip-run mccabe -- -m mccabe --min 14 Lib/configparser.py
940:4: 'RawConfigParser._read' 25
 cpython main @ gh pr checkout 117273
Switched to branch 'unnamed-section'
 cpython unnamed-section @ pip-run mccabe -- -m mccabe --min 14 Lib/configparser.py
961:4: 'RawConfigParser._read' 31

Originally posted by @jaraco in #117273 (comment)

Linked PRs

  • gh-117348: Refactored RawConfigParser._read for simplicity and comprehensibility #117372
  • gh-117348: restore import time performance of configparser #117703
Reacted by Pedro Lacerda

Activity

  1. jaraco
    self-assigned this
    on Mar 28, 2024
  2. jaraco commented on Mar 28, 2024

    @jaraco
    jaraco
    on Mar 28, 2024
    MemberAuthor
    More actions

    I've begun work on refactoring the code in jaraco:feature/refactor-configparser-read-complexity. That branch currently is based on #117273.

    Reacted by Pedro Lacerda
  3. jaraco
    added
    type-featureA feature request or enhancementA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    triagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.
    on Mar 28, 2024
  4. jaraco
    added a commit that references this issue on Mar 29, 2024

    gh-117348: Refactored RawConfigParser._read for similicity and compre…

    019143f
  5. jaraco
    closed this as completedon Mar 29, 2024
  6. NGRsoftlab
    added 2 commits that reference this issue on Apr 2, 2024

    Squashed commit of the following:

    1b5fe4c

    Squashed commit of the following:

    a016a54
  7. jaraco
    added a commit that references this issue on Apr 14, 2024

    gh-117348: restore import time performance of configparser (#117703)

    9c93b74
  8. diegorusso
    added 2 commits that reference this issue on Apr 17, 2024

    pythongh-117348: Refactored RawConfigParser._read for similicity and …

    90d0eeb

    pythongh-117348: restore import time performance of configparser (pyt…

    fb65a6c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jaraco
    jaraco

Labels

stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.