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 — GitHub - semcod/reko: Refaktoryzacja hardkodowanych wartości, struktur i kodu w projektach Python

BranchesTags
Open more actions menu

Latest commit

 

History

21 Commits
21 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.governance
.governance
 
 
docs
docs
 
 
examples
examples
 
 
project
project
 
 
src/reko
src/reko
 
 
testql-scenarios
testql-scenarios
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.nojekyll
.nojekyll
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SUMD.md
SUMD.md
 
 
SUMR.md
SUMR.md
 
 
TODO.md
TODO.md
 
 
VERSION
VERSION
 
 
app.doql.less
app.doql.less
 
 
goal.yaml
goal.yaml
 
 
index.html
index.html
 
 
local.dev.txt
local.dev.txt
 
 
planfile.yaml
planfile.yaml
 
 
prefact.yaml
prefact.yaml
 
 
project.sh
project.sh
 
 
pyproject.toml
pyproject.toml
 
 
tree.sh
tree.sh
 
 
uv.lock
uv.lock
 
 

Repository files navigation

reko

AI Cost Tracking

PyPI Version Python License AI Cost Human Time Model

  • 🤖 LLM usage: $0.7300 (4 commits)
  • 👤 Human dev: ~$332 (3.3h @ $100/h, 30min dedup)

Generated on 2026-07-06 using openrouter/qwen/qwen3-coder-next


Narzędzie do wykrywania i refaktoryzacji hardkodowanych wartości, struktur danych i kodu w projektach Python.

Co robi

  • scan — wykrywa magic numbers, długie stringi, osadzone słowniki/listy, powtarzające się literały
  • extract — wyciąga hardkod do modułu stałych (constants.py lub wskazany plik)
  • split — rozbija duże struktury (dict/list) na mniejsze nazwane fragmenty
  • move — przenosi stałe między modułami i aktualizuje importy
  • remove — usuwa nieużywane stałe modułowe
  • apply — stosuje plan refaktoryzacji (YAML/JSON)

Instalacja

cd ~/github/semcod/reko
pip install -e ".[apply,dev]"

Użycie

# skan projektu
reko scan .

# skan z raportem JSON
reko scan src/ --format json -o report.json

# wyciągnij hardkod do constants.py (dry-run)
reko extract src/ --target src/myapp/constants.py --dry-run

# rozbij dużą strukturę w pliku
reko split src/config.py --min-keys 5

# przenieś stałe
reko move src/old.py src/new_constants.py --names TIMEOUT,API_URL

# usuń nieużywane stałe
reko remove src/constants.py --dry-run

# zastosuj plan
reko apply plan.yaml

Konfiguracja

Plik reko.yaml w katalogu projektu:

scan:
  extensions: [".py"]
  exclude:
    - "**/tests/**"
    - "**/__pycache__/**"
  min_string_length: 8
  min_dict_keys: 4
  allowed_numbers: [0, 1, -1, 2, 10, 100, 1000]

extract:
  target: "constants.py"
  naming: "upper_snake"
  group_by: "file"  # file | kind | none

API

from pathlib import Path
from reko import scan_project, extract_constants, apply_plan

findings = scan_project(Path("src/"))
result = extract_constants(Path("src/app.py"), target=Path("src/constants.py"))

Licencja

Apache-2.0

About

Refaktoryzacja hardkodowanych wartości, struktur i kodu w projektach Python

semcod.github.io/reko/

Topics

code-qualityconstantshardcodedllmmagic-numberspythonrefactoringsemcodstatic-analysis

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

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.