Tabnine Logo
ResourceUtils.isPackage
Code IndexAdd Tabnine to your IDE (free)

How to use
isPackage
method
in
org.sonar.api.resources.ResourceUtils

Best Java code snippets using org.sonar.api.resources.ResourceUtils.isPackage (Showing top 3 results out of 315)

origin: org.codehaus.sonar-plugins/sonar-useless-code-tracker-plugin

@Override
public void decorate(Resource resource, DecoratorContext context) {
 if (!ResourceUtils.isFile(resource) && !ResourceUtils.isPackage(resource)) {
  double lines = 0.0;
  Measure duplicated = context.getMeasure(TrackerMetrics.USELESS_DUPLICATED_LINES);
  if (duplicated != null ) {
   lines += MeasureUtils.getValue(duplicated, 0.0);
   context.saveMeasure(TrackerMetrics.TOTAL_USELESS_LINES, lines);
  }
 }
}

origin: org.codehaus.sonar-plugins/sonar-abacus-plugin

private void computeAbacusComplexity(Resource rsrc, DecoratorContext dc) {
 if (ResourceUtils.isFile(rsrc) || ResourceUtils.isPackage(rsrc) || ResourceUtils.isDirectory(rsrc)
  || ResourceUtils.isRootProject(rsrc) || ResourceUtils.isModuleProject(rsrc)) {
  Double fileComplexity = MeasureUtils.getValue(dc.getMeasure(CoreMetrics.FILE_COMPLEXITY), Double.NaN);
  if (!Double.isNaN(fileComplexity)) {
   dc.saveMeasure(new Measure(AbacusMetrics.ABACUS_COMPLEXITY, ComplexityThresholdsUtils.convertCyclomaticComplexityToAbacusComplexity(fileComplexity, complexityThresholds)));
  }
 }
}
origin: org.codehaus.sonar-plugins/sonar-abacus-plugin

private void computeAbacusComplexityDistribution(Resource rsrc, DecoratorContext dc) {
 if (ResourceUtils.isPackage(rsrc) || ResourceUtils.isDirectory(rsrc)) {
  ComplexityThresholdsUtils.initCounterThreshold(complexityThresholds);
  for (Measure measure : dc.getChildrenMeasures(AbacusMetrics.ABACUS_COMPLEXITY)) {
   for (ComplexityThreshold complexityThreshold : complexityThresholds) {
    if (measure.getData() != null && measure.getData().equals(complexityThreshold.getComplexityName())) {
     complexityThreshold.incrementCounter(1);
     break;
    }
   }
  }
  dc.saveMeasure(new Measure(AbacusMetrics.ABACUS_COMPLEXITY_DISTRIBUTION, ComplexityThresholdsUtils.buildComplexityDistributionMeasureValue(complexityThresholds)));
 } else if (ResourceUtils.isRootProject(rsrc) || ResourceUtils.isModuleProject(rsrc)) {
  ComplexityThresholdsUtils.initCounterThreshold(complexityThresholds);
  for (Measure measure : dc.getChildrenMeasures(AbacusMetrics.ABACUS_COMPLEXITY_DISTRIBUTION)) {
   String[] distribution = measure.getData().split(";");
   for (String aDistribution : distribution) {
    String[] tmp = aDistribution.split("=");
    for (ComplexityThreshold complexityThreshold : complexityThresholds) {
     if (tmp[0].equals(complexityThreshold.getComplexityName())) {
      complexityThreshold.incrementCounter(Integer.parseInt(tmp[1]));
      break;
     }
    }
   }
  }
  dc.saveMeasure(new Measure(AbacusMetrics.ABACUS_COMPLEXITY_DISTRIBUTION, ComplexityThresholdsUtils.buildComplexityDistributionMeasureValue(complexityThresholds)));
 }
}
org.sonar.api.resourcesResourceUtilsisPackage

Popular methods of ResourceUtils

  • isUnitTestClass
  • isFile
    Alias for #isEntity(Resource)
  • isEntity
  • isProject
    This method equal isRootProject(resource) or isModuleProject(resource)
  • isSet
  • isUnitTestFile
  • isDirectory
    Alias for #isSpace(Resource)
  • isModuleProject
  • isRootProject
  • isPersistable
  • isSubview
  • isView
  • isSubview,
  • isView,
  • isLibrary,
  • isSpace

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • String (java.lang)
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Option (scala)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now