Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cyberark/migrate-slosilo-gem #2853

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

cyberark/migrate-slosilo-gem #2853

wants to merge 2 commits into from

Conversation

sofiadimant1
Copy link

Desired Outcome

Please describe the desired outcome for this PR. Said another way, what was
the original request that resulted in these code changes? Feel free to copy
this information from the connected issue.

Implemented Changes

Describe how the desired outcome above has been achieved with this PR. In
particular, consider:

  • What's changed? Why were these changes made?
  • How should the reviewer approach this PR, especially if manual tests are required?
  • Are there relevant screenshots you can add to the PR description?

Connected Issue/Story

Resolves #[relevant GitHub issue(s), e.g. 76]

CyberArk internal issue ID: [insert issue ID]

Definition of Done

At least 1 todo must be completed in the sections below for the PR to be
merged.

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: [insert issue ID]
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

@sofiadimant1 sofiadimant1 requested review from a team as code owners July 10, 2023 13:44
# The recommended way to use this option is to pass a proc-ish that identifies the record.
# Note the proc-ish can be a simple method name; for example in case of a Sequel::Model:
# attr_encrypted :secret, aad: :pk
def attr_encrypted *a
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method attr_encrypted has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.

# unrecognized claims.
#
# @param token [JWT] pre-parsed token to verify
def validate_jwt token
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method validate_jwt has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.

require 'slosilo/errors'

module Slosilo
class Key
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class Key has 24 methods (exceeds 20 allowed). Consider refactoring.

end

# Try to convert by detecting token representation and parsing
def self.JWT raw
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method JWT has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.

# untag, will use cache next time if available but no junk will be left
docker rmi $iid

rm $cidfile
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double quote to prevent globbing and word splitting.

@sofiadimant1 sofiadimant1 force-pushed the sofia/test branch 3 times, most recently from f51b6ce to 464377e Compare July 10, 2023 14:06
@sofiadimant1 sofiadimant1 marked this pull request as draft July 10, 2023 14:06
docker rm $cid

# untag, will use cache next time if available but no junk will be left
docker rmi $iid
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double quote to prevent globbing and word splitting.

docker cp $cid:/app/spec/reports spec/
docker cp $cid:/app/coverage spec

docker rm $cid
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double quote to prevent globbing and word splitting.

cid=$(cat $cidfile)

docker cp $cid:/app/spec/reports spec/
docker cp $cid:/app/coverage spec
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double quote to prevent globbing and word splitting.


cid=$(cat $cidfile)

docker cp $cid:/app/spec/reports spec/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double quote to prevent globbing and word splitting.

cidfile=$(mktemp -u)
docker run --cidfile $cidfile -v /app/spec/reports $iid bundle exec rake jenkins || :

cid=$(cat $cidfile)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double quote to prevent globbing and word splitting.

@codeclimate
Copy link

codeclimate bot commented Jul 10, 2023

Code Climate has analyzed commit 464377e and detected 308 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 67
Style 232
Bug Risk 9

The test coverage on the diff in this pull request is 82.6% (50% is the threshold).

This pull request will bring the total coverage in the repository to 86.9% (-1.3% change).

View more on Code Climate.

@sofiadimant1 sofiadimant1 marked this pull request as ready for review July 10, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant