Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

fix(halstead): Perl __END__ data section counted as one operand

Open Beginner friendly
#1,644 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
perl, rust
Domain
backend, data

Research direction

Start in big-code-analysis-ast/src/getter/perl.rs at the P::SpecialLiteral operand arm, then inspect the tree-sitter node children shown in the issue to distinguish special variables from __END__ and __DATA__ sections. Check the existing Perl operand tests and add cases for both markers with trailing data; done means those sections add no operand while supported special variables remain operands. The issue also asks whether tokens should count the section, so check its existing tests and document the behavior.

Written by the indexing model from the issue text.

Description

bug

Describe the bug

tree-sitter-perl wraps __END__ / __DATA__ and the whole data section after it in one special_literal node, the same kind it uses for __FILE__. The Perl getter classifies P::SpecialLiteral as an operand (big-code-analysis-ast/src/getter/perl.rs, the operand arm), so the marker plus every byte after it becomes one Halstead operand. Its text is the section's contents, so two files that differ only in their data section have different operand sets.

package P;
1;
__END__
aaa

bca dump:

╰─ {special_literal:220} from (3, 1) to (5, 1)
   ├─ {__END__:8} from (3, 1) to (3, 8) : __END__
   ╰─ {data_not_for_compiler:212} from (3, 8) to (5, 1)

bca ops lists an operand __END__\naaa\n; dropping __END__ from a file removes one operand (noend.pm 3 unique / 4 total vs end.pm 4 / 5 with the same code). tokens also grows by 2 (__END__ + data_not_for_compiler).

Expected

__END__ / __DATA__ end the program; neither they nor the data after them are operators or operands. Gate the SpecialLiteral operand arm on the child being __FILE__ / __LINE__ / __PACKAGE__ / __SUB__ (or exclude the END / DATA children), and decide whether tokens should count the section.

Found while fixing #1608 (LOC side of the same node).

Dominant language
Rust
Stars
32
Forks
3
Avg merge
2d 10h
Merged PRs (30d)
48

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dekobon/big-code-analysis

All issues in dekobon/big-code-analysis

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.