Business-DK-FI
view release on metacpan or search on metacpan
lib/Business/DK/FI.pm view on Meta::CPAN
=back
=head1 SUBROUTINES AND METHODS
=head2 validate
Takes a single argument. 15 digit FI number. Returns true (1) or false (0)
indicating whether the provided parameter adheres to specification.
=head2 validateFI
Less intrusive exported variation of L</validate>. It is actually L</validate>
which is wrapping L</validateFI>.
=head2 generate
Simple FI generation method. Takes an arbitrary number adhering to the following requirements:
=over
=item * length between 1 and 14
=item * value between 1 and 99999999999999
=back
Returns a valid FI number.
=head2 PRIVATE SUBROUTINES AND METHODS
=head2 _calculate_checksum
This method calculates a checksum, it takes a single number as parameter and returns the calculated checksum.
=head2 _calculate_sum
This method calculates a sum it takes a number and a reference to an array of control cifers. It calculates a single sum based on the number and the control cifer and returns this.
=head1 DIAGNOSTICS
All methods B<die> if their API is not respected. Method calls can with success be wrapped in L<Try::Tiny> or C<eval> blocks.
=head1 CONFIGURATION AND ENVIRONMENT
The module requires no special configuration or environment.
=head1 DEPENDENCIES
=over
=item * L<Params::Validate>
=item * L<Readonly>
=item * L<Exporter>
=item * L<English>
=back
=head1 BUGS AND LIMITATIONS
This module has no known bugs or limitations.
=head1 BUG REPORTING
Please report issues via CPAN RT:
=over
=item * L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-DK-FI>
=back
or by sending mail to
=over
=item * C<< <bug-Business-DK-FI@rt.cpan.org> >>
=back
=head1 TEST AND QUALITY
=head2 TEST COVERAGE
---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
blib/lib/Business/DK/FI.pm 100.0 100.0 n/a 100.0 100.0 34.8 100.0
...b/Class/Business/DK/FI.pm 97.6 83.3 n/a 100.0 100.0 65.2 96.9
Total 99.1 90.0 n/a 100.0 100.0 100.0 98.7
---------------------------- ------ ------ ------ ------ ------ ------ ------
=head1 QUALITY AND CODING STANDARD
The code passes L<Perl::Critic> tests at severity 1 (I<brutal>) with a set of policies disabled. please see F<t/perlcriticrc> and the list below:
=over
=item * L<Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma>, please
see: L<http://logiclab.jira.com/wiki/display/OPEN/Perl-Critic-Policy-ValuesAndExpressions-ProhibitConstantPragma>
=item * L<Perl::Critic::Policy::Documentation::RequirePodLinksIncludeText>, this
is listed in the L</TODO> it requires numerous changes to the distribution POD.
=item * L<Perl::Critic::Policy::NamingConventions::Capitalization>, L</validateFI> is exported both as L</validateFI> and L</validate> and B<FI> is our used acronym
so we try to stick to this
=item * L<Perl::Critic::Policy::ControlStructures::ProhibitCStyleForLoops>, this
is for the main algorithm, it was easier to do with a B<C-style for loop>
=item * L<Perl::Critic::Policy::Subroutines::RequireArgUnpacking>, this is due to
the way: L<Params::Validate> is used
=item * L<Perl::Critic::Policy::ValuesAndExpressions::ProhibitMagicNumbers>, we
use long control numbers
=item * L<Perl::Critic:.:Policy::Variables::ProhibitPunctuationVars>
=back
( run in 1.776 second using v1.01-cache-2.11-cpan-0fb53d1c279 )