Skip to content

Commit

Permalink
Develop (#25)
Browse files Browse the repository at this point in the history
* Feat/add makefile (#21)

* develop

* release/0.0.6

* feat: add Dockerized build and run support

- Added Makefile for Dockerized application
- Defined Docker image and version variables
- Included Docker commands for build, run, exec, stop, clean, and rebuild

Why: Facilitate easy development, testing, and deployment using Docker.

* test perl critic

* test perl critic

* fix

* syntax

* identation

* add path

* identation

* test

* test of rule

* fix

* remove examples

* remove rules

* fix code

* new policies

* fix linter errors

---------

Co-authored-by: Anderson Bosa <[email protected]>
Co-authored-by: Heitor Gouvêa <[email protected]>
  • Loading branch information
3 people authored Nov 12, 2023
1 parent 86a4e81 commit e63fe5f
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 317 deletions.
2 changes: 1 addition & 1 deletion .perlcriticrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
only = 1
include = ProhibitUnusedVariables ProhibitUnusedConstant ProhibitUnusedInclude ProhibitUnusedImport
include = ProhibitUnusedVariables ProhibitUnusedConstant ProhibitUnusedInclude ProhibitUnusedImport ProhibitUnreachableCode ProhibitComplexRegexes ProhibitDuplicatedSub ProhibitDuplicateHashKeys ProhibitUnusedPrivateSubroutines ProhibitUnlessBlocks ProhibitExcessiveColons ProhibitExplicitReturnUndef RequireCamelCase ProhibitMagicNumbers ProhibitTrailingWhitespace ProhibitHardTabs
16 changes: 0 additions & 16 deletions examples/CodeGraph.pm

This file was deleted.

177 changes: 0 additions & 177 deletions examples/chat.pl

This file was deleted.

44 changes: 0 additions & 44 deletions examples/gateway.pl

This file was deleted.

13 changes: 0 additions & 13 deletions examples/hello-world.pl

This file was deleted.

50 changes: 0 additions & 50 deletions examples/waf.pl

This file was deleted.

10 changes: 5 additions & 5 deletions lib/Zarn/AST.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package Zarn::AST {
$document -> prune("PPI::Token::Pod");
$document -> prune("PPI::Token::Comment");

foreach my $token (@{$document -> find("PPI::Token")}) {
foreach my $token (@{$document -> find("PPI::Token")}) {
foreach my $rule (@{$rules}) {
my @sample = $rule -> {sample} -> @*;
my $category = $rule -> {category};
Expand All @@ -30,10 +30,10 @@ package Zarn::AST {
if ($self -> matches_sample($token -> content(), \@sample)) {
$self -> process_sample_match($document, $category, $file, $title, $token);
}
}
}
}
}

return 1;
}

Expand All @@ -52,7 +52,7 @@ package Zarn::AST {
my $next_element = $token -> snext_sibling;

# this is a draft source-to-sink function
if (defined $next_element && ref $next_element && $next_element -> content() =~ /[\$\@\%](\w+)/) {
if (defined $next_element && ref $next_element && $next_element -> content() =~ /[\$\@\%](\w+)/) {
# perform taint analysis
$self -> perform_taint_analysis($document, $category, $file, $title, $next_element);
}
Expand All @@ -74,4 +74,4 @@ package Zarn::AST {
}
}

1;
1;
2 changes: 1 addition & 1 deletion lib/Zarn/Rules.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package Zarn::Rules {

if ($rules) {
my $yamlfile = YAML::Tiny -> read($rules);
my @rules = $yamlfile -> [0] -> {rules};
my @rules = $yamlfile -> [0] -> {rules};

return @rules;
}
Expand Down
20 changes: 10 additions & 10 deletions zarn.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ sub main {

if (!$source) {
print "
\rZarn v0.0.5
\rCore Commands
\r==============
\r\tCommand Description
\r\t------- -----------
\r\t-s, --source Configure a source directory to do static analysis
\r\t-r, --rules Define YAML file with rules
\r\t-i, --ignore Define a file or directory to ignore
\r\t-h, --help To see help menu of a module
\n";
\rZarn v0.0.5
\rCore Commands
\r==============
\r\tCommand Description
\r\t------- -----------
\r\t-s, --source Configure a source directory to do static analysis
\r\t-r, --rules Define YAML file with rules
\r\t-i, --ignore Define a file or directory to ignore
\r\t-h, --help To see help menu of a module\n
";

exit 1;
}
Expand Down

0 comments on commit e63fe5f

Please sign in to comment.