Showing 79 of 214 total issues
Function uploadCustomIni
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const uploadCustomIni = (options: UploadRequestOption) => {
upload(
options,
(file) => {
setCustomIniFile(file);
Function Diagnose
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Diagnose = ({
ui,
loadedToothLogs,
tuneData,
}: {
- 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 StarButton
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const StarButton = ({ tuneData }: { tuneData: TuneDataState }) => {
const navigate = useNavigate();
const { currentUserToken } = useAuth();
const { toggleStar, isStarredByMe } = useDb();
const [currentStars, setCurrentStars] = useState(tuneData.stars);
- 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 fetchWithProgress
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const fetchWithProgress = async (
url: string,
onProgress?: OnProgress,
signal?: AbortSignal,
): Promise<ArrayBuffer> => {
- 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 resolveDialogs
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const resolveDialogs = (source: DialogsType, dialogName: string) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!source[dialogName]) {
return;
}
Function searchTunes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const searchTunes = async (
search: string,
page: number,
perPage: number,
): Promise<TunesResponseList> => {
Function Hub
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const Hub = () => {
const { xs } = useBreakpoint();
const { searchTunes } = useDb();
const navigate = useNavigate();
const [dataSource, setDataSource] = useState<TunesResponse[]>([]);
- 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 SideBar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const SideBar = ({
config,
tune,
ui,
navigation,
- 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 clamp
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
nRange: number,
nMin: number,
nMax: number,
fRange: number,
fMin: number,
Function touchZoomPlugin
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const touchZoomPlugin = (): uPlotPlugin => {
return {
hooks: {
init(u, _opts, _data) {
const { over } = u;
- 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 ResultItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(
{
action,
active,
currentRootActionId,
- 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 Tune
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Tune = ({ config, tune }: { config: ConfigType | null; tune: TuneState | null }) => {
const dialogMatch = useMatch(Routes.TUNE_DIALOG);
const tuneRootMatch = useMatch(Routes.TUNE_TUNE);
const groupMenuDialogMatch = useMatch(Routes.TUNE_GROUP_MENU_DIALOG);
const { isConfigReady } = useConfig(config);
- 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 Profile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Profile = () => {
const [formProfile] = Form.useForm();
const { currentUser, sendEmailVerification, updateUsername, refreshUser } = useAuth();
const navigate = useNavigate();
const { getUserTunes } = useDb();
- 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 prepareConstDeclarations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const prepareConstDeclarations = (
tuneConstants: TuneConstantsType,
configPages: ConfigPageType[],
) =>
Object.keys(tuneConstants)
- 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
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return (
<div ref={containerRef} className="large-container">
{renderHelp(dialogConfig.help)}
<Form labelCol={{ span: 10 }} wrapperCol={{ span: 10 }}>
<Row gutter={20}>{panelsComponents}</Row>
Function mouseZoomPlugin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const mouseZoomPlugin = (options: ZoomPluginOptions = {}): uPlotPlugin => {
const { zoomFactor = 0.9 } = options;
let xMin: number;
let xMax: number;
- 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 checkMSL
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private checkMSL() {
const lines = this.raw.split('\n');
for (let index = 0; index < lines.length; index++) {
if (lines[index].startsWith('Time') || lines[index].startsWith('RPM')) {
this.isMSLLogs = true;
- 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 parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
parse(buffer: ArrayBuffer): this {
const raw = new TextDecoder().decode(buffer);
const xml = new DOMParser().parseFromString(raw, 'text/xml');
const xmlPages = xml.getElementsByTagName('page');
const bibliography = (xml.getElementsByTagName('bibliography')[0] as any)?.attributes;
- 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"