iiitv/ChefLib

View on GitHub

Showing 37 of 37 total issues

Function main has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    tc = int(input())
    for _ in range(tc):
        l, n = map(int, input().split())
        moves = input()
Severity: Minor
Found in 2017/APR/APRIL17/RNDGRID/RNDGRID.py - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function main has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    t = int(input())
    for i in range(t):
        l = list(input())
        six = l.count('6')
Severity: Minor
Found in 2017/SEPT/SEPT17/CHEFPDIG/CHEFPDIG.py - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function main has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    tc = int(input())
    for _ in range(tc):
        l, r = map(int, input().split())
        count = 0
Severity: Minor
Found in 2017/APR/APRIL17/DGTCNT/DGTCNT.py - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method main has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T, N, bef, a;
        int flag, flag1;
        T = sc.nextInt();
Severity: Minor
Found in 2017/AUG/AUG17/RAINBOWA/RAINBOWA.java - About 4 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method main has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static void main(String[] args) throws Exception {
        FastReader scan=new FastReader();
        int tc=scan.nextInt();
        while (tc--!=0) {
            int n=scan.nextInt();
Severity: Minor
Found in 2017/APR/APRIL17/SMARKET/SMARKET.java - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function main has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    tc = int(input())
    for _ in range(tc):
        p, q, q = map(int, input().split())
        a = tuple(map(int, input().split()))
Severity: Minor
Found in 2017/JUNE/JUNE17/SUMQ/SUMQ.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function main has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    tc = int(input())
    primes = [1, 2, 5, 9, 13]
    appended = False
    for i in range(14, 501):
Severity: Minor
Found in 2017/JUNE/JUNE17/GOODSET/GOODSET.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method main has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public static void main(String[] args) throws Exception {
        Reader scan = new Reader();
        int n;
        long k;
        n = scan.nextInt();
Severity: Minor
Found in 2017/MAY/MAY17/CHEFCODE/CHEFCODE.java - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function main has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    tc = int(input())
    for _ in range(tc):
        string = input()
        init = string[0]
Severity: Minor
Found in 2017/JUNE/COOK83/ADACRA/ADACRA.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method main has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T, N, bef, a;
        int flag, flag1;
        T = sc.nextInt();
Severity: Major
Found in 2017/AUG/AUG17/RAINBOWA/RAINBOWA.java - About 2 hrs to fix

    Method main has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public static void main(String[] args)throws Exception
        {
        int tc;
       FastReader scan=new FastReader();
       int n,tmp1,tmp2,ans;
    Severity: Minor
    Found in 2017/JAN/JAN17/CAPIMOVE/CAPIMOVE.java - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function main has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def main():
        N = int(input())
        for _ in range(N):
            maxfreq = 0
            presentfreq = 0
    Severity: Minor
    Found in 2017/JULY/JULY17/CHEFSIGN/CHEFSIGN.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function main has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def main():
        t = int(input())
        for i in range(t):
            n = int(input())
            if n % 2 == 0:
    Severity: Minor
    Found in 2017/SEPT/SEPT17/MINPERM/MINPERM.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function main has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def main():
        n, k = map(int, input().split())
        nums = list(map(int, input().split()))
        products = []
        answer = 0
    Severity: Minor
    Found in 2017/MAY/MAY17/CHEFCODE/CHEFCODE.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method main has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static void main(String[] args) throws Exception {
            FastReader scan=new FastReader();
            int tc=scan.nextInt();
            while (tc--!=0) {
                int n=scan.nextInt();
    Severity: Minor
    Found in 2017/APR/APRIL17/SMARKET/SMARKET.java - About 1 hr to fix

      Method main has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static void main(String[] args)throws Exception
          {
          int tc;
         FastReader scan=new FastReader();
         int n,tmp1,tmp2,ans;
      Severity: Minor
      Found in 2017/JAN/JAN17/CAPIMOVE/CAPIMOVE.java - About 1 hr to fix

        Method main has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static void main(String[] args) throws Exception {
                Reader scan = new Reader();
                int n;
                long k;
                n = scan.nextInt();
        Severity: Minor
        Found in 2017/MAY/MAY17/CHEFCODE/CHEFCODE.java - About 1 hr to fix

          Function main has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          def main():
              tc = int(input())
              for _ in range(tc):
                  n, k = map(int, input().split())
                  ans = 0
          Severity: Minor
          Found in 2017/JUNE/JUNE17/UNIONSET/UNIONSET.py - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function main has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          def main():
              n, k, p = input().split()
              arr = list(map(int, input().split()))
              str = input()
              y = 0
          Severity: Minor
          Found in 2017/MAY/MAY17/CHEFSUBA/CHEFSUBA.py - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function calculate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          def calculate(check, yes):
              for i in range(len(check)):
                  temp = check[0:i+1]
                  j = 0
                  for _ in range(len(yes)):
          Severity: Minor
          Found in 2017/MAY/MAY17/WSITES01/WSITES01.py - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Severity
          Category
          Status
          Source
          Language