diff --git a/apps/files/ajax/scan.php b/apps/files/ajax/scan.php
index 5cd9572d7f99eb3328cfb53edff52f6d98b9834a..a819578e3092fd221572a44222883b0a4e58aa1a 100644
--- a/apps/files/ajax/scan.php
+++ b/apps/files/ajax/scan.php
@@ -6,13 +6,14 @@ $force=isset($_GET['force']) and $_GET['force']=='true';
 $dir=isset($_GET['dir'])?$_GET['dir']:'';
 $checkOnly=isset($_GET['checkonly']) and $_GET['checkonly']=='true';
 
+$eventSource=false;
 if(!$checkOnly) {
 	$eventSource=new OC_EventSource();
 }
 
 session_write_close();
 
-//create the file cache if necesary
+//create the file cache if necessary
 if($force or !OC_FileCache::inCache('')) {
 	if(!$checkOnly) {
 		OCP\DB::beginTransaction();
diff --git a/apps/files_encryption/templates/settings.php b/apps/files_encryption/templates/settings.php
index 268b1a80ccd10e26df27eeceda2e961a7eb4e6c5..61bfe849c72b48d68b76be239526f050639f8e70 100644
--- a/apps/files_encryption/templates/settings.php
+++ b/apps/files_encryption/templates/settings.php
@@ -2,7 +2,7 @@
 	<fieldset class="personalblock">
 		<legend><strong><?php echo $l->t('Encryption');?></strong></legend>
 		<input type='checkbox'<?php if ($_['encryption_enabled']): ?> checked="checked"<?php endif; ?>
-			   id='enable_encryption' ></input>
+			   id='enable_encryption' />
 		<label for='enable_encryption'><?php echo $l->t('Enable Encryption')?></label><br />
 		<select id='encryption_blacklist' title="<?php echo $l->t('None')?>" multiple="multiple">
 			<?php foreach ($_['blacklist'] as $type): ?>
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index 6c5bc579c30ea05326d2fb5ee54009d51f24af53..920aefc12dee703e0f9cd4d9f4dc4510df5d1200 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -234,12 +234,11 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
 		$path1=$this->cleanPath($path1);
 		$path2=$this->root.$this->cleanPath($path2);
 		try {
-			$response=$this->client->request('MOVE', $path1, null, array('Destination'=>$path2));
+			$this->client->request('MOVE', $path1, null, array('Destination'=>$path2));
 			return true;
 		} catch(Exception $e) {
 			echo $e;
 			echo 'fail';
-			var_dump($response);
 			return false;
 		}
 	}
@@ -248,12 +247,11 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
 		$path1=$this->cleanPath($path1);
 		$path2=$this->root.$this->cleanPath($path2);
 		try {
-			$response=$this->client->request('COPY', $path1, null, array('Destination'=>$path2));
+			$this->client->request('COPY', $path1, null, array('Destination'=>$path2));
 			return true;
 		} catch(Exception $e) {
 			echo $e;
 			echo 'fail';
-			var_dump($response);
 			return false;
 		}
 	}
diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php
index 6e27f43d576aebdcccf3c63e120176986a5ac868..6071240e58320c9572742a6185efc1f224885d52 100644
--- a/apps/files_versions/history.php
+++ b/apps/files_versions/history.php
@@ -28,7 +28,6 @@ $tmpl = new OCP\Template( 'files_versions', 'history', 'user' );
 if ( isset( $_GET['path'] ) ) {
 
 	$path = $_GET['path'];
-	$path = $path;
 	$tmpl->assign( 'path', $path );
 	$versions = new OCA_Versions\Storage();
 
diff --git a/core/templates/installation.php b/core/templates/installation.php
index 3128c4f2e7040233da77efe8427149420285e97c..03c580c9b0b0c12c58bd5dd75cbd452c88da486b 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -1,7 +1,7 @@
-<input type='hidden' id='hasMySQL' value='<?php echo $_['hasMySQL'] ?>'></input>
-<input type='hidden' id='hasSQLite' value='<?php echo $_['hasSQLite'] ?>'></input>
-<input type='hidden' id='hasPostgreSQL' value='<?php echo $_['hasPostgreSQL'] ?>'></input>
-<input type='hidden' id='hasOracle' value='<?php echo $_['hasOracle'] ?>'></input>
+<input type='hidden' id='hasMySQL' value='<?php echo $_['hasMySQL'] ?>'>
+<input type='hidden' id='hasSQLite' value='<?php echo $_['hasSQLite'] ?>'>
+<input type='hidden' id='hasPostgreSQL' value='<?php echo $_['hasPostgreSQL'] ?>'>
+<input type='hidden' id='hasOracle' value='<?php echo $_['hasOracle'] ?>'>
 <form action="index.php" method="post">
 <input type="hidden" name="install" value="true" />
 	<?php if(count($_['errors']) > 0): ?>
diff --git a/lib/cache/apc.php b/lib/cache/apc.php
index 6dda0a0ff8c8fb858a93943fd282a8ef27d3079f..895d307ea26bd9c5d9a2fc6529660568e912642d 100644
--- a/lib/cache/apc.php
+++ b/lib/cache/apc.php
@@ -57,7 +57,7 @@ class OC_Cache_APC {
 if(!function_exists('apc_exists')) {
 	function apc_exists($keys)
 	{
-		$result;
+		$result=false;
 		apc_fetch($keys, $result);
 		return $result;
 	}
diff --git a/lib/migrate.php b/lib/migrate.php
index 62ab00bc332d776bf7bf1f234ff95cd54224360a..87bdd016fe469f4791954f8f9d0db920b52b68df 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -655,7 +655,7 @@ class OC_Migrate{
 		$query = OC_DB::prepare( "INSERT INTO `*PREFIX*users` ( `uid`, `password` ) VALUES( ?, ? )" );
 		$result = $query->execute( array( $uid, $hash));
 		if( !$result ) {
-			OC_Log::write('migration', 'Failed to create the new user "'.$uid."");
+			OC_Log::write('migration', 'Failed to create the new user "'.$uid."", OC_Log::ERROR);
 		}
 		return $result ? true : false;
 
diff --git a/lib/migration/content.php b/lib/migration/content.php
index 00df62f0c7fafada2f669c10b64eaa8cdae2b000..e81c8f217ff2ed784552913fe7fefd13131775d0 100644
--- a/lib/migration/content.php
+++ b/lib/migration/content.php
@@ -66,7 +66,7 @@ class OC_Migration_Content{
 
 		// Die if we have an error (error means: bad query, not 0 results!)
 		if( PEAR::isError( $query ) ) {
-			$entry = 'DB Error: "'.$result->getMessage().'"<br />';
+			$entry = 'DB Error: "'.$query->getMessage().'"<br />';
 			$entry .= 'Offending command was: '.$query.'<br />';
 			OC_Log::write( 'migration', $entry, OC_Log::FATAL );
 			return false;
diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php
index 4564a1e9f1f8646010e0bffb11265babfc9399ae..faafe9a62ddaa57bbec833c04927fe08b97353a9 100644
--- a/lib/ocs/cloud.php
+++ b/lib/ocs/cloud.php
@@ -24,7 +24,7 @@
 
 class OC_OCS_Cloud {
 
-	public static function getSystemWebApps($parameters) {
+	public static function getSystemWebApps() {
 		OC_Util::checkLoggedIn();
 		$apps = OC_App::getEnabledApps();
 		$values = array();
@@ -45,7 +45,7 @@ class OC_OCS_Cloud {
 			if(OC_User::userExists($parameters['user'])) {
 				// calculate the disc space
 				$userDir = '/'.$parameters['user'].'/files';
-				OC_Filesystem::init($useDir);
+				OC_Filesystem::init($userDir);
 				$rootInfo = OC_FileCache::get('');
 				$sharedInfo = OC_FileCache::get('/Shared');
 				$used = $rootInfo['size'] - $sharedInfo['size'];
diff --git a/lib/public/app.php b/lib/public/app.php
index 809a656f17f52da143e27c105295a677345b7079..a1ecf524cc84110440378a9452aad77b05068a49 100644
--- a/lib/public/app.php
+++ b/lib/public/app.php
@@ -89,7 +89,7 @@ class App {
 	 * @param $page string page to be included
 	*/
 	public static function registerPersonal( $app, $page ) {
-		return \OC_App::registerPersonal( $app, $page );
+		\OC_App::registerPersonal( $app, $page );
 	}
 
 	/**
@@ -98,7 +98,7 @@ class App {
 	 * @param $page string page to be included
 	 */
 	public static function registerAdmin( $app, $page ) {
-		return \OC_App::registerAdmin( $app, $page );
+		\OC_App::registerAdmin( $app, $page );
 	}
 
 	/**
@@ -125,10 +125,9 @@ class App {
 	/**
 	 * @brief Check if the app is enabled, redirects to home if not
 	 * @param $app app
-	 * @returns true/false
 	*/
 	public static function checkAppEnabled( $app ) {
-		return \OC_Util::checkAppEnabled( $app );
+		\OC_Util::checkAppEnabled( $app );
 	}
 
 	/**
diff --git a/lib/public/files.php b/lib/public/files.php
index 90889c59ad851a47a07812e9f8ef87ce8f82584f..75e1d2fbbc1095783789295d958c15ee9dd9a040 100644
--- a/lib/public/files.php
+++ b/lib/public/files.php
@@ -38,9 +38,10 @@ class Files {
 	 * @brief Recusive deletion of folders
 	 * @param string $dir path to the folder
 	 *
+	 * @return bool
 	 */
 	static function rmdirr( $dir ) {
-		\OC_Helper::rmdirr( $dir );
+		return \OC_Helper::rmdirr( $dir );
 	}
 
 	/**
diff --git a/lib/public/response.php b/lib/public/response.php
index bfb84eda5d1753c334497e62e066365a0363e4d4..de0c3f253471c83a49de84b0bab357f80d15272e 100644
--- a/lib/public/response.php
+++ b/lib/public/response.php
@@ -42,7 +42,7 @@ class Response {
 	*  null		cache indefinitly
 	*/
 	static public function enableCaching( $cache_time = null ) {
-		return(\OC_Response::enableCaching( $cache_time ));
+		\OC_Response::enableCaching( $cache_time );
 	}
 
 	/**
@@ -51,7 +51,7 @@ class Response {
 	* @param string $lastModified time when the reponse was last modified
 	*/
 	static public function setLastModifiedHeader( $lastModified ) {
-		return(\OC_Response::setLastModifiedHeader( $lastModified ));
+		\OC_Response::setLastModifiedHeader( $lastModified );
 	}
 
 	/**
@@ -59,7 +59,7 @@ class Response {
 	* @see enableCaching with cache_time = 0
 	*/
 	static public function disableCaching() {
-		return(\OC_Response::disableCaching());
+		\OC_Response::disableCaching();
 	}
 
 	/**
@@ -68,7 +68,7 @@ class Response {
 	* @param string $etag token to use for modification check
 	*/
 	static public function setETagHeader( $etag ) {
-		return(\OC_Response::setETagHeader( $etag ));
+		\OC_Response::setETagHeader( $etag );
 	}
 
 	/**
@@ -76,7 +76,7 @@ class Response {
 	* @param string $filepath of file to send
 	*/
 	static public function sendFile( $filepath ) {
-		return(\OC_Response::sendFile( $filepath ));
+		\OC_Response::sendFile( $filepath );
 	}
 
 	/**
@@ -86,7 +86,7 @@ class Response {
 	*  DateTime object when to expire response
 	*/
 	static public function setExpiresHeader( $expires ) {
-		return(\OC_Response::setExpiresHeader( $expires ));
+		\OC_Response::setExpiresHeader( $expires );
 	}
 
 	/**
@@ -94,6 +94,6 @@ class Response {
 	* @param string $location to redirect to
 	*/
 	static public function redirect( $location ) {
-		return(\OC_Response::redirect( $location ));
+		\OC_Response::redirect( $location );
 	}
 }
diff --git a/lib/public/share.php b/lib/public/share.php
index 8c0cfc16b4eb3d77d49fba6e7c505fc134635a63..7ed1c42490dd83f27607936a77b2bb068732cd60 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -748,7 +748,7 @@ class Share {
 					$itemTypes = $collectionTypes;
 				}
 				$placeholders = join(',', array_fill(0, count($itemTypes), '?'));
-				$where .= ' WHERE `item_type` IN ('.$placeholders.'))';
+				$where = ' WHERE `item_type` IN ('.$placeholders.'))';
 				$queryArgs = $itemTypes;
 			} else {
 				$where = ' WHERE `item_type` = ?';
diff --git a/lib/public/util.php b/lib/public/util.php
index df09ea81ae1ac265be398b774e5e66aeb9a95c45..1320ffabd807d31c780426d0de7951ecb858f515 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -298,7 +298,7 @@ class Util {
 	 * Todo: Write howto
 	 */
 	public static function callCheck() {
-		return(\OC_Util::callCheck());
+		\OC_Util::callCheck();
 	}
 
 	/**
diff --git a/ocs/routes.php b/ocs/routes.php
index d77b96fc1452372e889f75cb046a27eaa5dda337..d6ee589df6ffe593f73dbd5b8c319d546334b14a 100644
--- a/ocs/routes.php
+++ b/ocs/routes.php
@@ -17,4 +17,4 @@ OC_API::register('get', '/privatedata/getattribute/{app}', array('OC_OCS_Private
 OC_API::register('get', '/privatedata/getattribute/{app}/{key}', array('OC_OCS_Privatedata', 'get'), 'ocs', OC_API::USER_AUTH);
 OC_API::register('post', '/privatedata/setattribute/{app}/{key}', array('OC_OCS_Privatedata', 'set'), 'ocs', OC_API::USER_AUTH);
 OC_API::register('post', '/privatedata/deleteattribute/{app}/{key}', array('OC_OCS_Privatedata', 'delete'), 'ocs', OC_API::USER_AUTH);
-?>
+
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index 5ee0147fbcb32fc42f0e593fd8da328bf7bc235c..683b4a407acaa80ad66823a16a6c9c139e32898b 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -188,7 +188,7 @@ endfor;?>
         <?php endforeach;?>
     </table>
     <?php if ($_['entriesremain']): ?>
-    <input id='moreLog' type='button' value='<?php echo $l->t('More');?>...'></input>
+    <input id='moreLog' type='button' value='<?php echo $l->t('More');?>...'>
     <?php endif; ?>
 
 </fieldset>
diff --git a/tests/lib/filestorage/commontest.php b/tests/lib/filestorage/commontest.php
index 89e83589e5db2ee8851b2ed5b713f2946c976134..6719fcff4e871fd1f8ec4fb75f4818ac7f304df0 100644
--- a/tests/lib/filestorage/commontest.php
+++ b/tests/lib/filestorage/commontest.php
@@ -38,4 +38,3 @@ class Test_Filestorage_CommonTest extends Test_FileStorage {
 	}
 }
 
-?>
\ No newline at end of file
diff --git a/tests/lib/filestorage/local.php b/tests/lib/filestorage/local.php
index f68fb69b97fe4c0b3c75e3e6e2220b1f97b97834..d7d71e8f3728b9afc614c89c7475f5c780946413 100644
--- a/tests/lib/filestorage/local.php
+++ b/tests/lib/filestorage/local.php
@@ -35,4 +35,3 @@ class Test_Filestorage_Local extends Test_FileStorage {
 	}
 }
 
-?>
\ No newline at end of file