Skip to content

Sourcery Starbot ⭐ refactored CdtDelta/YOP#1

Open
SourceryAI wants to merge 1 commit intoCdtDelta:masterfrom
SourceryAI:master
Open

Sourcery Starbot ⭐ refactored CdtDelta/YOP#1
SourceryAI wants to merge 1 commit intoCdtDelta:masterfrom
SourceryAI:master

Conversation

@SourceryAI
Copy link
Copy Markdown

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch https://github.com/sourcery-ai-bot/YOP master
git merge --ff-only FETCH_HEAD
git reset HEAD^

pwdSize = 4
key_attempt = ''.join((random.choice(chars)) for x in range(pwdSize))
return key_attempt
return ''.join((random.choice(chars)) for x in range(pwdSize))
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function fvde_key refactored with the following changes:

  • Inline variable that is only used once

bit_values = BitArray(parse_data)
binary_values = bit_values.bin
return binary_values
return bit_values.bin
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function hash_data_parse refactored with the following changes:

  • Inline variable that is only used once

pwdSize = 4
key_attempt = ''.join((random.choice(chars)) for x in range(pwdSize))
return key_attempt
return ''.join((random.choice(chars)) for x in range(pwdSize))
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function fvde_key refactored with the following changes:

  • Inline variable that is only used once

}
desc_db_state = dict_db_state[db_state]
return desc_db_state
return dict_db_state[db_state]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function trans_db_state refactored with the following changes:

  • Inline variable that is only used once

Comment on lines +4 to +16


# Licensed under the GPL
# http://www.gnu.org/copyleft/gpl.html
#
# Version 1.0
# Tom Yarrish

import sys
import dns.resolver
import dns.reversename

ip_count = dict()
ip_top_count = list()
ip_count = {}
ip_top_count = []
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Lines 9-15 refactored with the following changes:

  • Replace list() with []
  • Replace dict() with {}

def devide(x, y):
answer = x / y
return answer
return x / y
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function devide refactored with the following changes:

  • Inline variable that is only used once

Comment on lines -18 to +17
answer = x * y
return answer
return x * y
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function multeply refactored with the following changes:

  • Inline variable that is only used once

"?" : "Unknown"}
opcode = dns_opcode[opcode]
return opcode
return dns_opcode[opcode]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function dns_opcode_parse refactored with the following changes:

  • Inline variable that is only used once

Comment on lines -31 to +30
flag_values = []
for flag_letter in flaglist:
flag_values.append(dns_flags[flag_letter])
return flag_values
return [dns_flags[flag_letter] for flag_letter in flaglist]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function dns_flags_parse refactored with the following changes:

  • Convert for loop into list comprehension
  • Inline variable that is only used once

def ie_sig_ver_parse(decoder):
ie_sig_ver_func = decoder[0:28]
return ie_sig_ver_func
return decoder[0:28]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function ie_sig_ver_parse refactored with the following changes:

  • Inline variable that is only used once

"?" : "Unknown"}
opcode = dns_opcode[opcode]
return opcode
return dns_opcode[opcode]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function dns_opcode_parse refactored with the following changes:

  • Inline variable that is only used once

Comment on lines -53 to +52
flag_values = []
for flag_letter in flaglist:
flag_values.append(dns_flags[flag_letter])
return flag_values
return [dns_flags[flag_letter] for flag_letter in flaglist]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function dns_flags_parse refactored with the following changes:

  • Convert for loop into list comprehension
  • Inline variable that is only used once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant