eager_eye 1.2.1 → 1.2.2
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 +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/eager_eye/detectors/concerns/non_ar_source_detector.rb +1 -1
- data/lib/eager_eye/detectors/custom_method_query.rb +8 -1
- data/lib/eager_eye/detectors/loop_association.rb +4 -1
- data/lib/eager_eye/version.rb +1 -1
- 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: a432b16aece37497880140ff64a88cd3dabe6ae603846a513d21f71a8b11b5a1
|
|
4
|
+
data.tar.gz: 330aac1ef792a5ca24597dcd4128329e20f05959ea45437e244788b94f12026d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 192aa6bb71494f09091ac64a44de11526db09ec389cf41db80229457d59d52f5e81c9b9ae05cc6892ec11c646078a12520c657940a986c47f6519af6b956526f
|
|
7
|
+
data.tar.gz: 3e18421c967675ea0c10ab19ff7f0426d2a2d8e2fcf969a20b6bc0571f0f32a40c8f515b16c464df57c67b447fe0e9c3b3087b22cee37bbda3bee89b1dd3d418
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.2] - 2026-01-31
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **CustomMethodQuery False Positive** - Skip PostgreSQL array column methods
|
|
15
|
+
- Methods ending with `_ids`, `_tags`, `_types`, `_codes`, `_names`, `_values` now recognized as array attributes
|
|
16
|
+
- `sector_subcategory_ids.first` no longer flagged (Ruby Array#first, not AR query)
|
|
17
|
+
|
|
18
|
+
- **LoopAssociation False Positive** - Skip common non-association attribute methods
|
|
19
|
+
- Added `origin`, `priority`, `level`, `kind`, `label`, `code`, `reason`, `amount`, `price`, `quantity`, `url`, `path`, `email`, `phone`, `address`, `notes`, `memo`, `data`, `metadata`, `position`, `rank`, `score`, `rating`, `enabled`, `disabled`, `active`, `published`, `draft`, `archived`, `locked`, `visible`, `hidden` to excluded methods
|
|
20
|
+
- Note: `category` and `tag` remain detectable as they're common association names - use inline suppression if they're string attributes in your codebase
|
|
21
|
+
|
|
22
|
+
- **PluckToArray False Positive** - Skip params-originated values
|
|
23
|
+
- `params[:ids].split(',').map(&:to_i)` no longer flagged
|
|
24
|
+
- `params` method now recognized as non-ActiveRecord source
|
|
25
|
+
|
|
10
26
|
## [1.2.1] - 2026-01-31
|
|
11
27
|
|
|
12
28
|
### Fixed
|
data/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://github.com/hamzagedikkaya/eager_eye/actions/workflows/main.yml"><img src="https://github.com/hamzagedikkaya/eager_eye/actions/workflows/main.yml/badge.svg" alt="CI"></a>
|
|
13
|
-
<a href="https://rubygems.org/gems/eager_eye"><img src="https://img.shields.io/badge/gem-v1.2.
|
|
13
|
+
<a href="https://rubygems.org/gems/eager_eye"><img src="https://img.shields.io/badge/gem-v1.2.2-red.svg" alt="Gem Version"></a>
|
|
14
14
|
<a href="https://github.com/hamzagedikkaya/eager_eye"><img src="https://img.shields.io/badge/coverage-95%25-brightgreen.svg" alt="Coverage"></a>
|
|
15
15
|
<a href="https://www.ruby-lang.org/"><img src="https://img.shields.io/badge/ruby-%3E%3D%203.1-ruby.svg" alt="Ruby"></a>
|
|
16
16
|
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
@@ -6,7 +6,7 @@ module EagerEye
|
|
|
6
6
|
module NonArSourceDetector
|
|
7
7
|
NON_AR_RECEIVERS = %w[Sidekiq Redis Resque DelayedJob Queue Job Hash Array Set].freeze
|
|
8
8
|
NON_DB_SOURCE_METHODS = %i[smembers sinter sunion sdiff zrange zrangebyscore lrange hkeys hvals hgetall
|
|
9
|
-
keys values entries args].freeze
|
|
9
|
+
keys values entries args params].freeze
|
|
10
10
|
|
|
11
11
|
private
|
|
12
12
|
|
|
@@ -7,6 +7,7 @@ module EagerEye
|
|
|
7
7
|
maximum].freeze
|
|
8
8
|
SAFE_QUERY_METHODS = %i[first last take count sum find size length ids].freeze
|
|
9
9
|
SAFE_TRANSFORM_METHODS = %i[keys values split [] params sort pluck ids to_s to_a to_i chars bytes].freeze
|
|
10
|
+
ARRAY_COLUMN_SUFFIXES = %w[_ids _tags _types _codes _names _values].freeze
|
|
10
11
|
ITERATION_METHODS = %i[each map select find_all reject collect detect find_index flat_map].freeze
|
|
11
12
|
|
|
12
13
|
def self.detector_name
|
|
@@ -124,7 +125,13 @@ module EagerEye
|
|
|
124
125
|
def receiver_ends_with_safe_transform_method?(node)
|
|
125
126
|
return false unless node.is_a?(Parser::AST::Node) && node.type == :send
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
method_name = node.children[1]
|
|
129
|
+
SAFE_TRANSFORM_METHODS.include?(method_name) || array_column_method?(method_name)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def array_column_method?(method_name)
|
|
133
|
+
method_str = method_name.to_s
|
|
134
|
+
ARRAY_COLUMN_SUFFIXES.any? { |suffix| method_str.end_with?(suffix) }
|
|
128
135
|
end
|
|
129
136
|
|
|
130
137
|
def add_issue(node)
|
|
@@ -19,7 +19,10 @@ module EagerEye
|
|
|
19
19
|
id to_s to_h to_a to_json to_xml inspect class object_id nil? blank? present? empty?
|
|
20
20
|
any? none? size count length save save! update update! destroy destroy! delete delete!
|
|
21
21
|
valid? invalid? errors new? persisted? changed? frozen? name title body content text
|
|
22
|
-
description value key type status state created_at updated_at deleted_at
|
|
22
|
+
description value key type status state created_at updated_at deleted_at origin
|
|
23
|
+
priority level kind label code reason amount price quantity url path email phone
|
|
24
|
+
address notes memo data metadata position rank score rating enabled disabled active
|
|
25
|
+
published draft archived locked visible hidden
|
|
23
26
|
].freeze
|
|
24
27
|
|
|
25
28
|
def self.detector_name
|
data/lib/eager_eye/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eager_eye
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hamzagedikkaya
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01
|
|
11
|
+
date: 2026-02-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ast
|