Showing 97 of 107 total issues
Function checkDescriptionBanner
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const checkDescriptionBanner = async (
client: TeamSpeakClient | undefined,
presenceString: string | undefined,
data: SteamUser.PersonaData,
steamId: string
Function send
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const send = async function (req: Request, res: Response): Promise<any> {
log.info(`Received verification send request to ${req.body.dbid} from remote.`, {
type: 'website'
});
try {
Method to_toml
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_toml(hash_style: :expanded)
if is_a?(Hash)
values =
(hash_style == :flatten ? flatten : self).
select { |_k, v| !v.nil? }.
Function send
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const send = async function (req: Request, res: Response): Promise<any> {
log.info(`Received send request to ${req.body.dbid} from remote.`, { type: 'website' });
try {
const [client] = await findClients(
req,
Function login
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const login = async function (req: Request, res: Response): Promise<any> {
log.info(`Received login request from ${req.body.dbid}.`, { type: 'website' });
try {
const [client] = await findClients(
req,
Identical blocks of code found in 2 locations. Consider refactoring. Open
const {
Offline,
Online,
Busy,
Away,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
const {
Offline,
Online,
Busy,
Away,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function getColor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getColor(colorx, alphax = 1, defaultx = true) {
// change color hex to RGB
if (/^[#]/.test(colorx)) {
const c = this.hexToRgb(colorx);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method create_release_meta_file!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_release_meta_file!(current_commits, new_version)
release_meta_path = "#{RELEASE_META_DIR}/#{new_version}.toml"
# Grab all existing commits
existing_commits = get_existing_commits!
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Similar blocks of code found in 2 locations. Consider refactoring. Open
try {
delete require.cache[require.resolve(path.resolve(file))];
// eslint-disable-next-line @typescript-eslint/no-var-requires
const plugin = require(path.resolve(file));
validatePlugin(plugin.info)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 60.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
try {
delete require.cache[require.resolve(path.resolve(file))];
// eslint-disable-next-line @typescript-eslint/no-var-requires
const game = require(path.resolve(file));
validateGame(game.info)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 60.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function main
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const main = async function (): Promise<void> {
const { data } = info.config;
const serverInfo = await Ts3.serverInfo();
const edited_name = {
'[ONLINE]': data.showQueryClients
Method parse_commit_message!
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_commit_message!(message)
match = message.match(/^(?<type>[a-z]*)(\((?<scope>[a-z0-9_,\- ]*)\))?(?<breaking_change>!)?: (?<description>.*?)( \(#(?<pr_number>[0-9]*)\))?$/)
if match.nil?
raise <<~EOF
Function main
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const main = async function (): Promise<void> {
const { data } = info.config;
const clients = await Ts3.clientList({ clientType: 0 });
clients.forEach(async (client) => {
if (client.isAfk(data.minTime) && client.cid !== data.dest) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
schema
.validateAsync(plugin)
.then((result) => {
resolve(result.value);
})
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
schema
.validateAsync(game)
.then((result) => {
resolve(result.value);
})
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function rColor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
rColor(colorx, opacity = 1) {
if (/^[#]/.test(colorx)) {
const c = this.hexToRgb(colorx);
colorx = `rgba(${c.r},${c.g},${c.b},${opacity})`;
} else if (/^[rgb]/.test(colorx)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function loadGames
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
SteamUser.prototype.loadGames = async function (): Promise<void> {
getFiles(path.join(__dirname, '../../../core/Steam/games')).then((files) => {
const jsfiles = flattenArray(files).filter((f) => f.split('.').pop() === 'ts');
jsfiles.forEach((file) => {
try {
Function drawTextWithEmoji
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Canvas.CanvasRenderingContext2D.prototype.drawTextWithEmoji = async function (
fillType: string,
text: string,
x: number,
y: number,
Function changePosition
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
changePosition(elx, content, conditional) {
let topx = 0;
let leftx = 0;
let widthx = 0;
const scrollTopx = window.pageYOffset || document.documentElement.scrollTop;