Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Dec 1, 2020. It is now read-only.
/looongPublic archive

Discovery of Long Parameter List

License

NotificationsYou must be signed in to change notification settings

anapaulagomes/looong

Repository files navigation

Keeping eyes on long parameters list 🔍

Build StatusCode ClimateCode Health

Long parameter list is a code smell - a clue that there is a problem on your software design. To help you on this this module has been written to identify methods with long parameter list and to suggest parameters groups that could became potential object because they appear together.

Usage

Installing

$ make install

We recommend the use of virtual environment.

Running

$ python looong/main.py -d<directory>
Analyzed files: 553Analyzed methods: 2224render [django/shortcuts.py] ['request','template_name','context','content_type','status','using'] 6create [django/contrib/admin/filters.py] ['field','request','params','model','model_admin','field_path'] 6kml [django/contrib/gis/sitemaps/views.py] ['request','label','model','field_name','compress','using'] 6run [django/core/servers/basehttp.py] ['addr','port','wsgi_handler','ipv6','threading','server_cls'] 6data [django/contrib/gis/gdal/raster/band.py] ['data','offset','size','shape','as_memoryview'] 5kmz [django/contrib/gis/sitemaps/views.py] ['request','label','model','field_name','using'] 5dumps [django/core/signing.py] ['obj','key','salt','serializer','compress'] 5loads [django/core/signing.py] ['s','key','salt','serializer','max_age'] 5migrate [django/db/migrations/executor.py] ['targets','plan','state','fake','fake_initial'] 5connect [django/db/models/signals.py] ['receiver','sender','weak','dispatch_uid','apps'] 5

Goal

Methods with long parameter list pointing to a problem with OO principles. One of the approach to solve is creating objects with the parameters that appear more together. Our goal is cluster this parameters and suggest as objects.

LoooooooooooooooooooooooooooooooooooGAnalyzed files: 553Analyzed methods: 2224render [django/shortcuts.py] ['request', 'template_name', 'context', 'content_type', 'status', 'using'] 6create [django/contrib/admin/filters.py] ['field', 'request', 'params', 'model', 'model_admin', 'field_path'] 6kml [django/contrib/gis/sitemaps/views.py] ['request', 'label', 'model', 'field_name', 'compress', 'using'] 6run [django/core/servers/basehttp.py] ['addr', 'port', 'wsgi_handler', 'ipv6', 'threading', 'server_cls'] 6Correlated parameters and possible objects:(foo, bar)(foo, bar, barbar)

Development

Please seeour contribution guide.

About

Discovery of Long Parameter List

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp