<commit_before>package pharb.intellijPlugin.jscsSupport.inspection;

import com.intellij.codeInspection.LocalInspectionToolSession;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.lang.javascript.JSBundle;
import com.intellij.lang.javascript.inspections.JSInspection;
import com.intellij.lang.javascript.psi.JSFile;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import pharb.intellijPlugin.jscsSupport.parser.MessageContainer;

public class JscsInspection extends JSInspection {


    public static void registerProblem(ProblemsHolder problemsHolder, JSFile file, MessageContainer message) {
        PsiElement problemElement = findPsiElement(message.line, message.column, file);
        problemsHolder.registerProblem(problemElement, message.getDisplayMessage(), LocalQuickFix.EMPTY_ARRAY);
    }

    private static PsiElement findPsiElement(int line, int column, JSFile file) {
        com.intellij.openapi.editor.Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);<commit_msg>Use import for editor.Document<commit_after>package pharb.intellijPlugin.jscsSupport.inspection;

import com.intellij.codeInspection.LocalInspectionToolSession;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.lang.javascript.JSBundle;
import com.intellij.lang.javascript.inspections.JSInspection;
import com.intellij.lang.javascript.psi.JSFile;
import com.intellij.openapi.editor.Document;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import pharb.intellijPlugin.jscsSupport.parser.MessageContainer;

public class JscsInspection extends JSInspection {


    public static void registerProblem(ProblemsHolder problemsHolder, JSFile file, MessageContainer message) {
        PsiElement problemElement = findPsiElement(message.line, message.column, file);
        problemsHolder.registerProblem(problemElement, message.getDisplayMessage(), LocalQuickFix.EMPTY_ARRAY);
    }

    private static PsiElement findPsiElement(int line, int column, JSFile file) {
        Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
{'fraction_non_alphanumeric': 0.08431836091410559, 'fraction_numerical': 0.0, 'mean_word_length': 6.624624624624625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5527920', 'n_tokens_mistral': 750, 'n_tokens_neox': 729, 'n_words': 124}