codeclimate 0.88.0 → 0.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db683b567a7d3858d7c8678b8c8cb10b1558dbf82519b9a4b4e3d21132324831
4
- data.tar.gz: c21bdad9306f02f0ad286fbd6a6844bd9818c5f38a3588460e17f5938fa021d5
3
+ metadata.gz: 290f128d5daa878d879553ba1089579d935a2dbc46a15b0ecdb7c795235b239d
4
+ data.tar.gz: 25732f6735c9c25493d215f2b81f5919026fc06224320858ccff63c7f36cabbd
5
5
  SHA512:
6
- metadata.gz: e62cbbcb99c99c9393831f79e1b21dfce4c815a9e1bc5b402c593f9824000ea89b9fb434f0e883e8a5312d5c951e6b2cb167c4bcf653992212cee571286ef5d3
7
- data.tar.gz: c4c699f5eb1ca6cb843efc210717bf255e5c7bc57f45be3b3083262cac6162236949f145abf7729961defa97a63b3aa98a2eed040077493076f74f059e89a28d
6
+ metadata.gz: c0c85e4618e273990e7d5c541d3fef982eb458957bd1dff8a5c85cc7572051c2e56ab95bb4d71ddaeed4419d9a3ddf2b8d723e17bfbfe4531d1adbccebabb630
7
+ data.tar.gz: d25b4ace583a99eabf66e8ce7d9897042900c9cbf8930400c16dac6bff51b6f4ea7c1bd061df3879daa864b7504a9af8fa49b851728c97f45fcf87cdb551d3d6
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:
@@ -87,6 +89,8 @@ eslint:
87
89
  flog:
88
90
  channels:
89
91
  stable: codeclimate/codeclimate-flog
92
+ beta: codeclimate/codeclimate-flog:beta
93
+ flog-4-6-6: codeclimate/codeclimate-flog:flog-4-6-6
90
94
  description: Easy to read reporting of complexity/pain for Ruby code.
91
95
  git-legal:
92
96
  channels:
@@ -1,9 +1,12 @@
1
1
  module CC
2
2
  module Analyzer
3
3
  class StatsdContainerListener < ContainerListener
4
- def initialize(statsd)
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, metric_name)
37
+ def increment(engine, action)
35
38
  tags = engine_tags(engine)
39
+ metric = metric_name(action)
40
+
36
41
  # rubocop:disable Style/HashSyntax
37
- metrics(engine, metric_name).each { |metric| statsd.increment(metric, tags: tags) }
42
+ statsd.increment(metric, tags: tags)
38
43
  # rubocop:enable Style/HashSyntax
39
44
  end
40
45
 
41
- def timing(engine, metric_name, millis)
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
- metrics(engine, metric_name).each { |metric| statsd.timing(metric, millis, tags: tags) }
51
+ statsd.timing(metric, millis, tags: tags)
45
52
  # rubocop:enable Style/HashSyntax
46
53
  end
47
54
 
48
- def metrics(engine, metric_name)
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.88.0
4
+ version: 0.90.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-19 00:00:00.000000000 Z
11
+ date: 2023-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport