codeclimate 0.88.0 → 0.89.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/engines.yml +2 -0
- data/lib/cc/analyzer/statsd_container_listener.rb +16 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2136e43d5fa42ad6d159f140cd1acc59f61b5962200bdcb5625285b7decc665
|
4
|
+
data.tar.gz: 6a9fc985b270c738ca958db42f710e0747bdf1ecfdcfb4c701d36fc425b10cfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42402e02b05875363b3360ea954fbcf59aa815e46c6aa31f8db1084ddd47e9f910e170547e6a56c5772553f55667bb8987d7868b8713fece8ddaf16599ec4b3f
|
7
|
+
data.tar.gz: f79ca2893f0945b6d625cd79eeb7c9c9c62d5773c9677261b3148c8847f9ff922491495f8858f81b37e89b1a7ec11a6d7181b6c8a64c077f3e13dc7ad2af0ebb
|
data/config/engines.yml
CHANGED
@@ -10,6 +10,8 @@ apexmetrics:
|
|
10
10
|
bandit:
|
11
11
|
channels:
|
12
12
|
stable: codeclimate/codeclimate-bandit
|
13
|
+
beta: codeclimate/codeclimate-bandit:beta
|
14
|
+
bandit-1-7-4: codeclimate/codeclimate-bandit:bandit-1-7-4
|
13
15
|
description: A tool designed to find common security issues in Python code.
|
14
16
|
black:
|
15
17
|
channels:
|
@@ -1,9 +1,12 @@
|
|
1
1
|
module CC
|
2
2
|
module Analyzer
|
3
3
|
class StatsdContainerListener < ContainerListener
|
4
|
-
|
4
|
+
# rubocop:disable Lint/MissingSuper
|
5
|
+
def initialize(statsd, repo_id: nil)
|
5
6
|
@statsd = statsd
|
7
|
+
@repo_id = repo_id
|
6
8
|
end
|
9
|
+
# rubocop:enable Lint/MissingSuper
|
7
10
|
|
8
11
|
def started(engine, _details)
|
9
12
|
increment(engine, "started")
|
@@ -29,34 +32,34 @@ module CC
|
|
29
32
|
|
30
33
|
private
|
31
34
|
|
32
|
-
attr_reader :statsd
|
35
|
+
attr_reader :statsd, :repo_id
|
33
36
|
|
34
|
-
def increment(engine,
|
37
|
+
def increment(engine, action)
|
35
38
|
tags = engine_tags(engine)
|
39
|
+
metric = metric_name(action)
|
40
|
+
|
36
41
|
# rubocop:disable Style/HashSyntax
|
37
|
-
|
42
|
+
statsd.increment(metric, tags: tags)
|
38
43
|
# rubocop:enable Style/HashSyntax
|
39
44
|
end
|
40
45
|
|
41
|
-
def timing(engine,
|
46
|
+
def timing(engine, action, millis)
|
42
47
|
tags = engine_tags(engine)
|
48
|
+
metric = metric_name(action)
|
49
|
+
|
43
50
|
# rubocop:disable Style/HashSyntax
|
44
|
-
|
51
|
+
statsd.timing(metric, millis, tags: tags)
|
45
52
|
# rubocop:enable Style/HashSyntax
|
46
53
|
end
|
47
54
|
|
48
|
-
def
|
49
|
-
|
50
|
-
"engines.#{metric_name}",
|
51
|
-
"engines.names.#{engine.name}.#{metric_name}",
|
52
|
-
].tap do |metrics|
|
53
|
-
metrics << "engines.names.#{engine.name}.#{engine.channel}.#{metric_name}" if engine_channel_present?(engine)
|
54
|
-
end
|
55
|
+
def metric_name(action)
|
56
|
+
"engines.#{action}"
|
55
57
|
end
|
56
58
|
|
57
59
|
def engine_tags(engine)
|
58
60
|
["engine:#{engine.name}"].tap do |tags|
|
59
61
|
tags << "channel:#{engine.channel}" if engine_channel_present?(engine)
|
62
|
+
tags << "repo_id:#{repo_id}" if repo_id.present?
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.89.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|