Showing 49 of 138 total issues
Function BlogsSpeakerdeckPageComponent
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BlogsSpeakerdeckPageComponent = () => {
const state = useSelector((state: AppState) => state);
const dispatch = useDispatch();
const [loadCheckAuth] = useLazyQuery<CheckAuth>(CHECK_AUTH, {
Function patchBug
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
static patchBug(typeormConnection: any) {
// this is a copypasta of the existing typeorm Connection method
// with one line changed
// @ts-ignore
typeormConnection.prototype.findMetadata = function(
- 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 requestWebpush
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const requestWebpush = async () => {
if (typeof window === "undefined") return;
if (typeof navigator === "undefined" || typeof navigator.serviceWorker === "undefined") return;
if (typeof Notification === "undefined" || typeof Notification.requestPermission === "undefined") return;
- 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 IndexPageComponent
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IndexPageComponent = (props: Props) => {
const dispatch = useDispatch();
const [loadCheckAuth] = useLazyQuery<CheckAuth>(CHECK_AUTH, {
onCompleted: async checkAuth => {
if (!checkAuth.checkAuth) {
Function onload
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
fileReader.onload = async evt => {
if (evt.target && evt.target.result) {
const Wavesurfer = await import("wavesurfer.js");
// @ts-ignore
const timelinePlugin = await import("wavesurfer.js/dist/plugin/wavesurfer.timeline.js");
Function requestWebpush
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const requestWebpush = async () => {
if (typeof window === "undefined") return;
if (typeof navigator === "undefined" || typeof navigator.serviceWorker === "undefined") return;
if (typeof Notification === "undefined" || typeof Notification.requestPermission === "undefined") return;
Function BlogsHatenaEntryPageComponent
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BlogsHatenaEntryPageComponent = () => {
const state = useSelector((state: AppState) => state);
const dispatch = useDispatch();
const router = useRouter();
let name = process.browser
Function BlogsQiitaItemPageComponent
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BlogsQiitaItemPageComponent = () => {
const state = useSelector((state: AppState) => state);
const dispatch = useDispatch();
const router = useRouter();
Function saveScrapingHTML
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Mutation(() => SaveScrapingHTML, { nullable: true })
async saveScrapingHTML(
@Ctx() ctx: Context,
@Arg("html") html: string,
@Arg("url") url: string,
Function BlogsJinseiPageComponent
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BlogsJinseiPageComponent = (props: Props) => {
const state = useSelector((state: AppState) => state);
const dispatch = useDispatch();
const [loadCheckAuth] = useLazyQuery<CheckAuth>(CHECK_AUTH, {
Function main
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const main = async () => {
// https://github.com/MichalLytek/type-graphql/issues/869#issuecomment-824887201
(global as any).schema =
(global as any).schema ||
(await buildSchema({
Function _getMultiFormatDateTimeOptions
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const _getMultiFormatDateTimeOptions = (
options: GetMultiFormatDateTimeParamOption,
): GetMultiFormatDateTimeReturnOption => {
const newOptions: GetMultiFormatDateTimeReturnOption = {
Date: new Date(),
Function _getMultiFormatDateTimeOptions
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const _getMultiFormatDateTimeOptions = (
options: GetMultiFormatDateTimeParamOption,
): GetMultiFormatDateTimeReturnOption => {
const newOptions: GetMultiFormatDateTimeReturnOption = {
Date: new Date(),
Function main
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const main = () => {
const app = express();
const router = express.Router();
// Middleware
Function createWebPushUser
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Mutation(() => CreateWebPushUser, { nullable: true })
async createWebPushUser(
@Arg("endpoint") endpoint: string,
@Arg("auth") auth: string,
@Arg("p256dh") p256dh: string
Function ToolsScrapingPageComponent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const ToolsScrapingPageComponent = () => {
const state = useSelector((state: AppState) => state);
const dispatch = useDispatch();
const [url, setURL] = useState("");
- 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 _getMultiFormatDateTimeOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const _getMultiFormatDateTimeOptions = (
options: GetMultiFormatDateTimeParamOption,
): GetMultiFormatDateTimeReturnOption => {
const newOptions: GetMultiFormatDateTimeReturnOption = {
Date: new Date(),
- 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 _getMultiFormatDateTimeOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const _getMultiFormatDateTimeOptions = (
options: GetMultiFormatDateTimeParamOption,
): GetMultiFormatDateTimeReturnOption => {
const newOptions: GetMultiFormatDateTimeReturnOption = {
Date: new Date(),
- 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 deeply nested control flow statements. Open
if (results[i].isFinal) {
const text = results[results.length - 1][0].transcript;
jpTextElementRef.current.innerText = text;
logText = `${logText}
Avoid too many return
statements within this function. Open
return Promise.all(
items.map(async (item) => {
return apiGatewayManagementApi
.postToConnection({
ConnectionId: item.id,