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

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

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

origin: org.codehaus.sonar-plugins/sonar-issues-report-plugin

@Override
public void decorate(Resource resource, DecoratorContext context) {
 if (!ResourceUtils.isPersistable(resource)) {
  return;
 }
 File path = null;
 if (ResourceUtils.isProject(resource)) {
  path = fs.baseDir();
 } else if (resource.getPath() != null) {
  path = new File(fs.baseDir(), resource.getPath());
 }
 ResourceNode resourceNode = new ResourceNode(resource, path, fs.sourceCharset());
 RESOURCE_BY_KEY.put(resource.getEffectiveKey(), resourceNode);
 for (DecoratorContext childContext : context.getChildren()) {
  Resource child = childContext.getResource();
  ResourceNode childNode = RESOURCE_BY_KEY.get(child.getEffectiveKey());
  if (childNode != null) {
   resourceNode.addChild(childNode);
  }
 }
}
origin: org.codehaus.sonar/sonar-batch

@Override
public void decorate(Resource resource, DecoratorContext context) {
 if (ResourceUtils.isPersistable(resource) && !ResourceUtils.isUnitTestFile(resource)) {
  Long developmentCost = getDevelopmentCost(context);
  context.saveMeasure(new Measure(CoreMetrics.DEVELOPMENT_COST, Long.toString(developmentCost)));
  long debt = getMeasureValue(context, CoreMetrics.TECHNICAL_DEBT);
  double density = computeDensity(debt, developmentCost);
  context.saveMeasure(CoreMetrics.SQALE_DEBT_RATIO, 100.0 * density);
  SqaleRatingGrid ratingGrid = new SqaleRatingGrid(sqaleRatingSettings.getRatingGrid());
  context.saveMeasure(createRatingMeasure(ratingGrid.getRatingForDensity(density)));
 }
}
origin: org.codehaus.sonar/sonar-batch

private void persist(BatchResource batchResource) {
 if (batchResource.snapshot() != null) {
  // already persisted
  return;
 }
 BatchResource parentBatchResource = batchResource.parent();
 Snapshot s;
 if (parentBatchResource != null) {
  persist(parentBatchResource);
  s = persist(findModule(parentBatchResource), batchResource.resource(), parentBatchResource.resource());
 } else {
  // Root project
  s = persistProject((Project) batchResource.resource(), null);
 }
 batchResource.setSnapshot(s);
 if (ResourceUtils.isPersistable(batchResource.resource())) {
  graph.addComponent(batchResource.resource(), batchResource.snapshotId());
 }
}
org.sonar.api.resourcesResourceUtilsisPersistable

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
  • isPackage
  • isSubview
  • isView
  • isSubview,
  • isView,
  • isLibrary,
  • isSpace

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top 12 Jupyter Notebook extensions
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