<commit_before>package org.jetbrains.plugins.scala
package annotator

import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.psi.util.PsiTreeUtil
import createFromUsage._
import importsTracker._
import lang.psi.api.statements._
import lang.psi.api.toplevel.typedef._
import lang.psi.api.toplevel.templates.ScTemplateBody
import com.intellij.lang.annotation._

import lang.psi.api.toplevel.imports.{ScImportExpr, ScImportSelector}
import org.jetbrains.plugins.scala.lang.psi.api.base._
import org.jetbrains.plugins.scala.lang.resolve._
import com.intellij.codeInspection._
import org.jetbrains.plugins.scala.annotator.intention._
import params.{ScParameter, ScParameters, ScClassParameter}
import patterns.{ScPattern, ScInfixPattern}
import processor.MethodResolveProcessor
import modifiers.ModifierChecker
import com.intellij.psi._
import org.jetbrains.plugins.scala.annotator.quickfix.{WrapInOptionQuickFix, ChangeTypeFix, ReportHighlightingErrorQuickFix}
import template._
import com.intellij.openapi.project.DumbAware
import components.HighlightingAdvisor
import org.jetbrains.plugins.scala.extensions._
import collection.{mutable, Seq, Set}
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.usages.{ValueUsed, ImportUsed}
import org.jetbrains.plugins.scala.lang.psi.types._
import org.jetbrains.plugins.scala.lang.psi.api.expr._
import org.jetbrains.plugins.scala.lang.scaladoc.psi.api.ScDocResolvableCodeReference
import org.jetbrains.plugins.scala.lang.psi.impl.{ScalaPsiManager, ScalaPsiElementFactory}
import result.{TypingContext, TypeResult}
import org.jetbrains.plugins.scala.lang.psi.api.{ScalaElementVisitor, ScalaFile}
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.psi.api.toplevel._
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import highlighter.{DefaultHighlighter, AnnotatorHighlighter}
import org.jetbrains.plugins.scala.lang.psi.api.base.types._
import com.intellij.openapi.util.{TextRange, Key}
import collection.mutable.ArrayBuffer
import com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl
import org.jetbrains.plugins.scala.lang.psi.impl.expr.ScInterpolatedStringPrefixReference
import codeInspection.caseClassParamInspection.{RemoveValFromGeneratorIntentionAction, RemoveValFromEnumeratorIntentionAction}
import org.jetbrains.plugins.scala.lang.scaladoc.psi.impl.ScDocResolvableCodeReferenceImpl
import org.jetbrains.plugins.scala.lang.psi
import com.intellij.openapi.roots.ProjectFileIndex
import org.jetbrains.plugins.scala.lang.psi.types.ScDesignatorType
import scala.Some
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.usages.WriteValueUsed
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.usages.ReadValueUsed
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression.ExpressionTypeResult
import org.jetbrains.plugins.scala.lang.psi.types.result.Success
import com.intellij.internal.statistic.UsageTrigger
import org.jetbrains.plugins.scala.util.ScalaUtils

/**
 * User: <NAME>
 * Date: 23.06.2008
 */
class ScalaAnnotator extends Annotator with FunctionAnnotator with ScopeAnnotator
  with ParametersAnnotator with ApplicationAnnotator
  with AssignmentAnnotator with VariableDefinitionAnnotator
  with TypedStatementAnnotator with PatternDefinitionAnnotator
  with PatternAnnotator with ConstructorAnnotator
  with OverridingAnnotator with DumbAware {

  override def annotate(element: PsiElement, holder: AnnotationHolder) {
    val (compiled, isInSources) = element.getContainingFile match {
      case file: ScalaFile => (file.isCompiled, ScalaUtils.isUnderSources(file))
      case _ => (false, false)
    }

    val typeAware = isAdvancedHighlightingEnabled(element)
    val visitor = new ScalaElementVisitor {
      private def expressionPart(expr: ScExpression) {
        if (!compiled) {
          checkExpressionType(expr, holder, typeAware)
          checkExpressionImplicitParameters(expr, holder)
          ByNameParameter.annotate(expr, holder, typeAware)
        }
<commit_msg>File annotated statistics.<commit_after>package org.jetbrains.plugins.scala
package annotator

import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.psi.util.PsiTreeUtil
import createFromUsage._
import importsTracker._
import lang.psi.api.statements._
import lang.psi.api.toplevel.typedef._
import lang.psi.api.toplevel.templates.ScTemplateBody
import com.intellij.lang.annotation._

import lang.psi.api.toplevel.imports.{ScImportExpr, ScImportSelector}
import org.jetbrains.plugins.scala.lang.psi.api.base._
import org.jetbrains.plugins.scala.lang.resolve._
import com.intellij.codeInspection._
import org.jetbrains.plugins.scala.annotator.intention._
import params.{ScParameter, ScParameters, ScClassParameter}
import patterns.{ScPattern, ScInfixPattern}
import processor.MethodResolveProcessor
import modifiers.ModifierChecker
import com.intellij.psi._
import org.jetbrains.plugins.scala.annotator.quickfix.{WrapInOptionQuickFix, ChangeTypeFix, ReportHighlightingErrorQuickFix}
import template._
import com.intellij.openapi.project.DumbAware
import components.HighlightingAdvisor
import org.jetbrains.plugins.scala.extensions._
import collection.{mutable, Seq, Set}
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.usages.{ValueUsed, ImportUsed}
import org.jetbrains.plugins.scala.lang.psi.types._
import org.jetbrains.plugins.scala.lang.psi.api.expr._
import org.jetbrains.plugins.scala.lang.scaladoc.psi.api.ScDocResolvableCodeReference
import org.jetbrains.plugins.scala.lang.psi.impl.{ScalaPsiManager, ScalaPsiElementFactory}
import result.{TypingContext, TypeResult}
import org.jetbrains.plugins.scala.lang.psi.api.{ScalaElementVisitor, ScalaFile}
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.psi.api.toplevel._
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import highlighter.{DefaultHighlighter, AnnotatorHighlighter}
import org.jetbrains.plugins.scala.lang.psi.api.base.types._
import com.intellij.openapi.util.{TextRange, Key}
import collection.mutable.ArrayBuffer
import com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl
import org.jetbrains.plugins.scala.lang.psi.impl.expr.ScInterpolatedStringPrefixReference
import codeInspection.caseClassParamInspection.{RemoveValFromGeneratorIntentionAction, RemoveValFromEnumeratorIntentionAction}
import org.jetbrains.plugins.scala.lang.scaladoc.psi.impl.ScDocResolvableCodeReferenceImpl
import org.jetbrains.plugins.scala.lang.psi
import com.intellij.openapi.roots.ProjectFileIndex
import org.jetbrains.plugins.scala.lang.psi.types.ScDesignatorType
import scala.Some
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.usages.WriteValueUsed
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.usages.ReadValueUsed
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression.ExpressionTypeResult
import org.jetbrains.plugins.scala.lang.psi.types.result.Success
import com.intellij.internal.statistic.UsageTrigger
import org.jetbrains.plugins.scala.util.ScalaUtils

/**
 * User: <NAME>
 * Date: 23.06.2008
 */
class ScalaAnnotator extends Annotator with FunctionAnnotator with ScopeAnnotator
  with ParametersAnnotator with ApplicationAnnotator
  with AssignmentAnnotator with VariableDefinitionAnnotator
  with TypedStatementAnnotator with PatternDefinitionAnnotator
  with PatternAnnotator with ConstructorAnnotator
  with OverridingAnnotator with DumbAware {

  override def annotate(element: PsiElement, holder: AnnotationHolder) {
    val (compiled, isInSources) = element.getContainingFile match {
      case file: ScalaFile => (file.isCompiled, ScalaUtils.isUnderSources(file))
      case _ => (false, false)
    }

    if (isInSources) UsageTrigger.trigger("scala.file.annotated")

    val typeAware = isAdvancedHighlightingEnabled(element)

    if (isInSources && typeAware) UsageTrigger.trigger("scala.file.type.aware.annotated")

    val visitor = new ScalaElementVisitor {
      private def expressionPart(expr: ScExpression) {
        if (!compiled) {
          checkExpressionType(expr, holder, typeAware)
          checkExpressionImplicitParameters(expr, holder)
          ByNameParameter.annotate(expr, holder, typeAware)
        }

{'fraction_non_alphanumeric': 0.09019937545039634, 'fraction_numerical': 0.0019216910881575786, 'mean_word_length': 6.050804403048264, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1217331', 'n_tokens_mistral': 2652, 'n_tokens_neox': 2508, 'n_words': 399}