cosmos / gosec

Apache License 2.0
19 stars 6 forks source link

rules/sdk: permit map copying in G705 #28

Closed kirbyquerby closed 2 years ago

kirbyquerby commented 2 years ago

This change permits map copies of the form:

for k, v := range from {
    to[k] = v
}

It doesn't currently permit the alternative, which trickier to check for and doesn't really have any benefits:

for k := range from {
  to[k] = from[k]
}

Updates #24

codecov-commenter commented 2 years ago

Codecov Report

Merging #28 (f98c197) into master (f6f1167) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #28   +/-   ##
=======================================
  Coverage   70.86%   70.86%           
=======================================
  Files           9        9           
  Lines         587      587           
=======================================
  Hits          416      416           
  Misses        146      146           
  Partials       25       25           
Impacted Files Coverage Δ
analyzer.go 89.02% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f6f1167...f98c197. Read the comment docs.