{"id":31250522,"url":"https://github.com/nsgc/calltally","last_synced_at":"2026-01-20T17:03:42.144Z","repository":{"id":314571895,"uuid":"1056010809","full_name":"nsgc/calltally","owner":"nsgc","description":"Prism-based static method-call tally for Ruby/Rails.","archived":false,"fork":false,"pushed_at":"2025-12-27T03:15:00.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-28T19:06:25.443Z","etag":null,"topics":["ast","code-quality","developer-tools","metrics","prism","rails","refactoring","ruby","static-analysis"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/calltally","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nsgc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-13T07:57:00.000Z","updated_at":"2025-12-27T03:15:01.000Z","dependencies_parsed_at":"2025-09-13T10:50:15.927Z","dependency_job_id":"6bc98f26-7fff-4e09-be87-722103e10c62","html_url":"https://github.com/nsgc/calltally","commit_stats":null,"previous_names":["nsgc/calltally"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nsgc/calltally","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsgc%2Fcalltally","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsgc%2Fcalltally/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsgc%2Fcalltally/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsgc%2Fcalltally/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nsgc","download_url":"https://codeload.github.com/nsgc/calltally/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsgc%2Fcalltally/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ast","code-quality","developer-tools","metrics","prism","rails","refactoring","ruby","static-analysis"],"created_at":"2025-09-23T05:23:08.810Z","updated_at":"2026-01-20T17:03:42.126Z","avatar_url":"https://github.com/nsgc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calltally\n\n\u003e Tally your method calls.\n\nA simple yet powerful tool to analyze method usage in Ruby/Rails codebases. Quickly identify your most-used methods, understand code patterns, and make informed refactoring decisions.\n\n## Installation\n\nAdd to your Gemfile:\n\n```ruby\ngem 'calltally', group: :development\n```\n\nOr install globally:\n\n```bash\ngem install calltally\n```\n\n## Quick Start\n\n```bash\n# Analyze current directory\ncalltally\n\n# Analyze specific directory\ncalltally app/models\n\n# Show top 20 results\ncalltally --top 20\n\n# Focus on specific classes\ncalltally --receivers User,Post --top 10\n```\n\n## Usage Examples\n\n### Rails Projects\n\nCalltally automatically detects Rails projects and scans the right directories:\n\n```bash\n# Auto-detects Rails and scans app/, lib/, config/\ncalltally\n\n# Analyze specific file patterns\ncalltally app/models\n\n# Focus on ActiveRecord methods\ncalltally --methods where,find,joins --mode pairs\n```\n\n### Output Formats\n\n```bash\n# Default table format\ncalltally\n\n# JSON format for further processing\ncalltally --format json \u003e analysis.json\n\n# CSV for spreadsheet analysis\ncalltally --format csv -o results.csv\n```\n\n### Filtering and Analysis\n\n```bash\n# Show only method names (no receivers)\ncalltally --mode methods\n\n# Show only receivers (classes being called)\ncalltally --mode receivers\n\n# Show receiver-method pairs (default)\ncalltally --mode pairs\n\n# Include methods called without explicit receivers\ncalltally --include-nil-receiver\n```\n\n## Configuration\n\nCreate `.calltally.yml` in your project root for persistent settings:\n\n```yaml\n# .calltally.yml\nprofile: rails          # auto|rails|default\ndirs:                   # Directories to scan\n  - app\n  - lib\nexclude:                # Patterns to exclude\n  - spec\n  - test\n  - vendor\ntop: 50                 # Number of results to show\nmode: pairs            # pairs|methods|receivers\nskip_operators: true    # Skip operators like +, -, ==\n```\n\nYou can also use a custom config file:\n\n```bash\ncalltally --config config/calltally-production.yml\n```\n\n## Advanced Usage\n\n\u003cdetails\u003e\n\u003csummary\u003eFilter by Variable Types\u003c/summary\u003e\n\n```bash\n# Only local variables\ncalltally --only-locals\n\n# Only instance variables\ncalltally --only-ivars\n\n# Only class/module constants\ncalltally --only-constants\n\n# Class variables\ncalltally --only-cvars\n\n# Global variables\ncalltally --only-gvars\n\n# Combine filters\ncalltally --only-locals --only-constants\n\n# Show variable names instead of grouping\ncalltally --split-variables\n# Shows: (var:user).name instead of (var).name\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAll CLI Options\u003c/summary\u003e\n\n```\ncalltally [PATH] [options]\n\nOptions:\n  --profile PROFILE        auto|rails|default (default: auto)\n  -d, --dirs x,y           Directories to include\n  -x, --exclude x,y        Path parts to exclude\n  -n, --top N              Show top N results (default: 100)\n  -v, --verbose            Verbose output\n\n  --mode MODE              Output mode:\n                           - pairs: receiver-method pairs (default)\n                           - methods: method names only\n                           - receivers: receiver names only\n\n  --receivers x,y          Filter by receiver constants (e.g. User,Post)\n  --methods x,y            Filter by method names (e.g. where,find)\n\n  --include-nil-receiver   Count calls without explicit receiver\n  --split-variables        Show variable names (e.g. '(var:user)' vs '(var)')\n\n  --only-locals            Show only local variable receivers\n  --only-ivars             Show only instance variable receivers\n  --only-cvars             Show only class variable receivers\n  --only-gvars             Show only global variable receivers\n  --only-constants         Show only constant receivers\n\n  --[no-]skip-operators    Skip operator methods like +, -, ==, [] (default: true)\n\n  --format FORMAT          Output format: table|json|csv (default: table)\n  -o, --output PATH        Write result to file instead of STDOUT\n  --config PATH            Use a specific config file\n  -h, --help               Show help\n```\n\u003c/details\u003e\n\n## Understanding the Output\n\nCalltally shows method calls in your codebase with their receivers:\n\n```\n10  User.where          # User class, where method, called 10 times\n 5  (var).each          # Local variable, each method, called 5 times\n 3  (ivar).save         # Instance variable, save method\n 2  Post#.validate      # validate called within Post class (implicit receiver)\n```\n\n### Receiver Types\n\n- `User` - Class or module constant\n- `(var)` - Local variable (use `--split-variables` to see names)\n- `(ivar)` - Instance variable\n- `(cvar)` - Class variable\n- `(gvar)` - Global variable\n- `(self)` - Explicit self receiver\n- `(result)` - Method calls on results (e.g., `user.posts.first` → `(var).posts` + `(result).first`)\n- `#` - Implicit receiver (when using `--include-nil-receiver`)\n\n## Use Cases\n\n1. **Find most-used methods** - Identify candidates for optimization\n2. **Understand code patterns** - See how your team uses APIs\n3. **Refactoring decisions** - Know what methods are heavily depended upon\n4. **API design** - Understand which methods are actually used\n5. **Code reviews** - Quickly analyze unfamiliar codebases\n6. **Gem development** - See how your gem's methods are used\n\n## FAQ\n\n### Why does grep show different counts than CallTally?\n\nCallTally counts method **calls**, not all text occurrences:\n- `grep \"Current.user\"` finds both `Current.user` (getter) and `Current.user = value` (setter)\n- CallTally only counts `Current.user` (the getter method call)\n- Setters like `name=` are separate methods and not counted as `name`\n\n### Which file types are analyzed?\n\n- **Ruby files**: `.rb`, `.ru`, `.rake`\n- **Not included**: JavaScript, CSS, YAML, and other file types\n\n### Why do I see (result) as a receiver?\n\nWhen methods are chained, CallTally shows intermediate results as `(result)`:\n- `user.posts.first` → `(var).posts` + `(result).first`\n- This happens because CallTally doesn't infer types without type annotations\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/nsgc/calltally.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsgc%2Fcalltally","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsgc%2Fcalltally","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsgc%2Fcalltally/lists"}