小编alc*_*cor的帖子

我怎么能减少圈复杂度?

每当我拿出一段我正在处理的代码时,我就得到了This function's cyclomatic complexity is too high. (7).但我对如何以这种方式重写它有点困惑,所以它的工作原理.

这将是不断抛出该消息的函数:

function () {
  var duration = +new Date() - start.time,
    isPastHalf = Number(duration) < 250 && Math.abs(delta.x) > 20 || Math.abs(delta.x) > viewport / 2,
    direction = delta.x < 0;

  if (!isScrolling) {
    if (isPastHalf) {
      if (direction) {
        this.close();
      } else {
        if (this.content.getBoundingClientRect().left > viewport / 2 && pulled === true) {
          this.close();
          return;
        }
        this.open();
      }
    } else {
      if (this.content.getBoundingClientRect().left > viewport / 2) { …
Run Code Online (Sandbox Code Playgroud)

javascript cyclomatic-complexity jshint

15
推荐指数
2
解决办法
3万
查看次数

安装期间的错误代码2753

今天我需要在我的开发机器上重新安装Microsoft Pex.

我使用的是Windows 7,32位,Visual Studio 2010,.NET 2/3.5

我启动了通常的安装程序,但它因为一个神秘的2753错误而停止了.

我该如何进行安装?

windows-installer pex

5
推荐指数
1
解决办法
2万
查看次数