Evaluates the dependency by generating and saving the data related with dependency.
This method is invoked by cache before writing data into it.
424800
public function evaluateDependency()
	{
		if ($this->reuseDependentData)
		{
			$hash=$this->getHash();
			if(!isset(self::$_reusableData[$hash]['dependentData']))
				self::$_reusableData[$hash]['dependentData']=$this->generateDependentData();
			$this->_data=self::$_reusableData[$hash]['dependentData'];
		}
		else
			$this->_data=$this->generateDependentData();
	}
505754
def evaluate(context, locals, &block)
      return data unless stylus_file?(context)

      depend_on(context, data)
      data
    end
962853
void visitDependences(Archive source, Visitor v, Type level) {
        if (level == Type.SUMMARY) {
            final Dependences result = results.get(source);
            final Set<Archive> reqs = result.requires();
            Stream<Archive> stream = reqs.stream();
            if (reqs.isEmpty()) {
                if (hasDependences(source)) {
                    // If reqs.isEmpty() and we have dependences, then it means
                    // that the dependences are from 'source' onto itself.
                    stream = Stream.of(source);
                }
            }
            stream.sorted(Comparator.comparing(Archive::getName))
                  .forEach(archive -> {
                      Profile profile = result.getTargetProfile(archive);
                      v.visitDependence(source.getName(), source,
                                        profile != null ? profile.profileName()
                                                        : archive.getName(), archive);
                  });
        } else {
            Dependences result = results.get(source);
            if (level != type) {
                // requesting different level of analysis
                result = new Dependences(source, level);
                source.visitDependences(result);
            }
            result.dependencies().stream()
                  .sorted(Comparator.comparing(Dep::origin)
                                    .thenComparing(Dep::target))
                  .forEach(d -> v.visitDependence(d.origin(), d.originArchive(),
                                                  d.target(), d.targetArchive()));
        }
    }
681722
public void addDependency(Service service) {
        assertDuringInitialization();
        LOG.info("Adding a dependency on {} to {}", service.getName(), getName());
        addDependsOn(service);
        service.addDependedBy(this);
    }
925084
function readDependentJointsThatAreReady(unit, handleDependentJoint){
	//console.log("readDependentJointsThatAreReady "+unit);
	var t=Date.now();
	var from = unit ? "FROM dependencies AS src_deps JOIN dependencies USING(unit)" : "FROM dependencies";
	var where = unit ? "WHERE src_deps.depends_on_unit="+db.escape(unit) : "";
	var lock = unit ? mutex.lock : mutex.lockOrSkip;
	lock(["dependencies"], function(unlock){
		db.query(
			"SELECT dependencies.unit, unhandled_joints.unit AS unit_for_json, \n\
				SUM(CASE WHEN units.unit IS NULL THEN 1 ELSE 0 END) AS count_missing_parents \n\
			"+from+" \n\
			JOIN unhandled_joints ON dependencies.unit=unhandled_joints.unit \n\
			LEFT JOIN units ON dependencies.depends_on_unit=units.unit \n\
			"+where+" \n\
			GROUP BY dependencies.unit \n\
			HAVING count_missing_parents=0 \n\
			ORDER BY NULL", 
			function(rows){
				//console.log(rows.length+" joints are ready");
				//console.log("deps: "+(Date.now()-t));
				rows.forEach(function(row) {
					db.query("SELECT json, peer, "+db.getUnixTimestamp("creation_date")+" AS creation_ts FROM unhandled_joints WHERE unit=?", [row.unit_for_json], function(internal_rows){
						internal_rows.forEach(function(internal_row) {
							handleDependentJoint(JSON.parse(internal_row.json), parseInt(internal_row.creation_ts), internal_row.peer);
						});
					});
				});
				unlock();
			}
		);
	});
}
1171556
def recreate_parent_dependencies(apps, schema_editor):
    """"""
    Data = apps.get_model('flow', 'Data')
    DataDependency = apps.get_model('flow', 'DataDependency')

    def process_dependency(data, parent):
        if not Data.objects.filter(pk=parent).exists():
            DataDependency.objects.create(
                child=data, parent=None, kind='io'
            )

    for data in Data.objects.all():
        for field_schema, fields in iterate_fields(data.input, data.process.input_schema):
            name = field_schema['name']
            value = fields[name]

            if field_schema.get('type', '').startswith('data:'):
                process_dependency(data, value)

            elif field_schema.get('type', '').startswith('list:data:'):
                for parent in value:
                    process_dependency(data, parent)
165815
@Inject
   protected void injectDependencies(Cache cache) {
      this.queryCache = cache.getCacheManager().getGlobalComponentRegistry().getComponent(QueryCache.class);
      ComponentRegistry componentRegistry = cache.getAdvancedCache().getComponentRegistry();
      matcher = componentRegistry.getComponent(matcherImplClass);
      if (matcher == null) {
         throw new CacheException("Expected component not found in registry: " + matcherImplClass.getName());
      }
   }
959058
public final void evaluate() {
    final POSEvaluator evaluator = new POSEvaluator(this.posTagger);
    try {
      evaluator.evaluate(this.testSamples);
    } catch (IOException e) {
      e.printStackTrace();
    }
    System.out.println(evaluator.getWordAccuracy());
  }
104564
public function evaluateDependency($cache): void
    {
        foreach ($this->dependencies as $dependency) {
            $dependency->evaluateDependency($cache);
        }
    }
496084
@Override
    protected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException {
        //strip any path information that may get added by ArchiveAnalyzer, etc.
        final File f = dependency.getActualFile();
        final String fileName = FilenameUtils.removeExtension(f.getName());
        final String ext = FilenameUtils.getExtension(f.getName());
        if (!IGNORED_FILES.accept(f) && !"js".equals(ext)) {
            //add version evidence
            final DependencyVersion version = DependencyVersionUtil.parseVersion(fileName);
            final String packageName = DependencyVersionUtil.parsePreVersion(fileName);

            if (version != null) {
                // If the version number is just a number like 2 or 23, reduce the confidence
                // a shade. This should hopefully correct for cases like log4j.jar or
                // struts2-core.jar
                if (version.getVersionParts() == null || version.getVersionParts().size() < 2) {
                    dependency.addEvidence(EvidenceType.VERSION, "file", "version", version.toString(), Confidence.MEDIUM);
                } else {
                    dependency.addEvidence(EvidenceType.VERSION, "file", "version", version.toString(), Confidence.HIGHEST);
                }
                dependency.addEvidence(EvidenceType.VERSION, "file", "name", packageName, Confidence.MEDIUM);
            }

            dependency.addEvidence(EvidenceType.PRODUCT, "file", "name", packageName, Confidence.HIGH);
            dependency.addEvidence(EvidenceType.VENDOR, "file", "name", packageName, Confidence.HIGH);
        }
    }
788351
private void processDependencies() throws SQLException
   {
      List<Row> rows = getRows("select * from zdependency where zproject=?", m_projectID);
      for (Row row : rows)
      {
         Task nextTask = m_project.getTaskByUniqueID(row.getInteger("ZNEXTACTIVITY_"));
         Task prevTask = m_project.getTaskByUniqueID(row.getInteger("ZPREVIOUSACTIVITY_"));
         Duration lag = row.getDuration("ZLAG_");
         RelationType type = row.getRelationType("ZTYPE");
         Relation relation = nextTask.addPredecessor(prevTask, type, lag);
         relation.setUniqueID(row.getInteger("Z_PK"));
      }
   }
875143
@Override
    protected boolean evaluateDependencies(final Dependency dependency, final Dependency nextDependency, final Set<Dependency> dependenciesToRemove) {
        if (hashesMatch(dependency, nextDependency)) {
            if (!containedInWar(dependency.getFilePath())
                    && !containedInWar(nextDependency.getFilePath())) {
                if (firstPathIsShortest(dependency.getFilePath(), nextDependency.getFilePath())) {
                    mergeDependencies(dependency, nextDependency, dependenciesToRemove);
                } else {
                    mergeDependencies(nextDependency, dependency, dependenciesToRemove);
                    return true; //since we merged into the next dependency - skip forward to the next in mainIterator
                }
            }
        } else if (isShadedJar(dependency, nextDependency)) {
            if (dependency.getFileName().toLowerCase().endsWith("pom.xml")) {
                mergeDependencies(nextDependency, dependency, dependenciesToRemove);
                nextDependency.removeRelatedDependencies(dependency);
                return true;
            } else {
                mergeDependencies(dependency, nextDependency, dependenciesToRemove);
                dependency.removeRelatedDependencies(nextDependency);
            }
        } else if (cpeIdentifiersMatch(dependency, nextDependency)
                && hasSameBasePath(dependency, nextDependency)
                && vulnerabilitiesMatch(dependency, nextDependency)
                && fileNameMatch(dependency, nextDependency)) {
            if (isCore(dependency, nextDependency)) {
                mergeDependencies(dependency, nextDependency, dependenciesToRemove);
            } else {
                mergeDependencies(nextDependency, dependency, dependenciesToRemove);
                return true; //since we merged into the next dependency - skip forward to the next in mainIterator
            }
        } else if (ecoSystemIs(AbstractNpmAnalyzer.NPM_DEPENDENCY_ECOSYSTEM, dependency, nextDependency)
                && namesAreEqual(dependency, nextDependency)
                && npmVersionsMatch(dependency.getVersion(), nextDependency.getVersion())) {

            if (!dependency.isVirtual()) {
                DependencyMergingAnalyzer.mergeDependencies(dependency, nextDependency, dependenciesToRemove);
            } else {
                DependencyMergingAnalyzer.mergeDependencies(nextDependency, dependency, dependenciesToRemove);
                return true;
            }
        }
        return false;
    }
1083548
def depends (self, d):
        
        self.dependencies_ = unique (self.dependencies_ + d).sort ()
429764
function (dependencies, extension) {
            if (dependencies) {
                for (var i = dependencies.length - 1; i >= 0; i--) {
                    this.addDependency(dependencies[i], extension);
                }
            }
        }
1097637
@SuppressWarnings("ReferenceEquality")
    public synchronized void addRelatedDependency(Dependency dependency) {
        if (this == dependency) {
            LOGGER.warn("Attempted to add a circular reference - please post the log file to issue #172 here "
                    + "https://github.com/jeremylong/DependencyCheck/issues/172");
            LOGGER.debug("this: {}", this);
            LOGGER.debug("dependency: {}", dependency);
        } else if (!relatedDependencies.add(dependency)) {
            LOGGER.debug("Failed to add dependency, likely due to referencing the same file as another dependency in the set.");
            LOGGER.debug("this: {}", this);
            LOGGER.debug("dependency: {}", dependency);
        }
    }
863657
public static void save(final File file, final Dependencies dependencies) {
        Utils4J.checkNotNull("file", file);
        Utils4J.checkValidFile(file);
        final XStream xstream = createXStream();
        try {
            final Writer writer = new FileWriter(file);
            try {
                xstream.toXML(dependencies, writer);
            } finally {
                writer.close();
            }
        } catch (final IOException ex) {
            throw new RuntimeException(ex);
        }
    }
878485
@Override
    protected void analyzeDependency(Dependency dependency, Engine engine)
            throws AnalysisException {
        if (needToDisableGemspecAnalyzer) {
            boolean failed = true;
            final String className = RubyGemspecAnalyzer.class.getName();
            for (FileTypeAnalyzer analyzer : engine.getFileTypeAnalyzers()) {
                if (analyzer instanceof RubyBundlerAnalyzer) {
                    ((RubyBundlerAnalyzer) analyzer).setEnabled(false);
                    LOGGER.info("Disabled {} to avoid noisy duplicate results.", RubyBundlerAnalyzer.class.getName());
                } else if (analyzer instanceof RubyGemspecAnalyzer) {
                    ((RubyGemspecAnalyzer) analyzer).setEnabled(false);
                    LOGGER.info("Disabled {} to avoid noisy duplicate results.", className);
                    failed = false;
                }
            }
            if (failed) {
                LOGGER.warn("Did not find {}.", className);
            }
            needToDisableGemspecAnalyzer = false;
        }
        final File parentFile = dependency.getActualFile().getParentFile();
        final Process process = launchBundleAudit(parentFile);
        final int exitValue;
        try {
            exitValue = process.waitFor();
        } catch (InterruptedException ie) {
            Thread.currentThread().interrupt();
            throw new AnalysisException("bundle-audit process interrupted", ie);
        }
        if (exitValue < 0 || exitValue > 1) {
            final String msg = String.format("Unexpected exit code from bundle-audit process; exit code: %s", exitValue);
            throw new AnalysisException(msg);
        }
        try {
            try (BufferedReader errReader = new BufferedReader(new InputStreamReader(process.getErrorStream(), StandardCharsets.UTF_8))) {
                while (errReader.ready()) {
                    final String error = errReader.readLine();
                    LOGGER.warn(error);
                }
            }
            try (BufferedReader rdr = new BufferedReader(new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8))) {
                processBundlerAuditOutput(dependency, engine, rdr);
            }
        } catch (IOException | CpeValidationException ioe) {
            LOGGER.warn("bundle-audit failure", ioe);
        }
    }