Skip to content

Commit

Permalink
Bump parser to b859 (#362)
Browse files Browse the repository at this point in the history
* Bump parser to b859

* Udate PHP threshold and points
  • Loading branch information
f-moya authored Mar 15, 2021
1 parent 3bebf62 commit 460d39c
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM codeclimate/codeclimate-parser:b850
FROM codeclimate/codeclimate-parser:b859
LABEL maintainer="Code Climate <hello@codeclimate.com>"

# Reset from base image
4 changes: 2 additions & 2 deletions lib/cc/engine/analyzers/php/main.rb
Original file line number Diff line number Diff line change
@@ -11,12 +11,12 @@ class Main < CC::Engine::Analyzers::Base
PATTERNS = [
"**/*.php",
].freeze
DEFAULT_MASS_THRESHOLD = 75
DEFAULT_MASS_THRESHOLD = 90
DEFAULT_FILTERS = [
"(Stmt_Use ___)",
"(comments ___)",
].freeze
POINTS_PER_OVERAGE = 35_000
POINTS_PER_OVERAGE = 29_000
REQUEST_PATH = "/php"

def use_sexp_lines?
16 changes: 8 additions & 8 deletions spec/cc/engine/analyzers/php/main_spec.rb
Original file line number Diff line number Diff line change
@@ -40,12 +40,12 @@
"path" => "foo.php",
"lines" => { "begin" => 2, "end" => 8 },
})
expect(json["remediation_points"]).to eq(965_000)
expect(json["remediation_points"]).to eq(967000)
expect(json["other_locations"]).to eq([
{"path" => "foo.php", "lines" => { "begin" => 10, "end" => 16} },
])
expect(json["content"]["body"]).to match(/This issue has a mass of 24/)
expect(json["fingerprint"]).to eq("367e371730140daeda61ab577c617236")
expect(json["content"]["body"]).to match(/This issue has a mass of 28/)
expect(json["fingerprint"]).to eq("b41447552cff977d3d98dff4cd282ec2")
expect(json["severity"]).to eq(CC::Engine::Analyzers::Base::MAJOR)
end

@@ -82,12 +82,12 @@
"path" => "foo.php",
"lines" => { "begin" => 2, "end" => 8 },
})
expect(json["remediation_points"]).to eq(965_000)
expect(json["remediation_points"]).to eq(967000)
expect(json["other_locations"]).to eq([
{"path" => "foo.php", "lines" => { "begin" => 10, "end" => 16} },
])
expect(json["content"]["body"]).to match(/This issue has a mass of 24/)
expect(json["fingerprint"]).to eq("8fe741c1e4cccc7226bbf6f0244fc49d")
expect(json["content"]["body"]).to match(/This issue has a mass of 28/)
expect(json["fingerprint"]).to eq("c4c0b456f59f109d0a5cfce7d4807935")
end

it "runs against complex files" do
@@ -238,7 +238,7 @@
"path" => "foo.php",
"lines" => { "begin" => 8, "end" => 14 },
)
expect(issue["content"]["body"]).to match(/This issue has a mass of 24/)
expect(issue["content"]["body"]).to match(/This issue has a mass of 28/)
end

it "ignores one-line comments" do
@@ -272,7 +272,7 @@
"path" => "foo.php",
"lines" => { "begin" => 4, "end" => 10 },
)
expect(issue["content"]["body"]).to match(/This issue has a mass of 24/)
expect(issue["content"]["body"]).to match(/This issue has a mass of 28/)
end
end
end

0 comments on commit 460d39c

Please sign in to comment.